diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 21:18:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 21:18:33 +0300 |
commit | f64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch) | |
tree | a2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /app/models/list.rb | |
parent | bfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff) |
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'app/models/list.rb')
-rw-r--r-- | app/models/list.rb | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/app/models/list.rb b/app/models/list.rb index 49834af3dfb..e1954ed72c4 100644 --- a/app/models/list.rb +++ b/app/models/list.rb @@ -14,17 +14,10 @@ class List < ApplicationRecord validates :label_id, uniqueness: { scope: :board_id }, if: :label? scope :preload_associated_models, -> { preload(:board, label: :priorities) } + scope :without_types, ->(list_types) { where.not(list_type: list_types) } alias_method :preferences, :list_user_preferences - class << self - def preload_preferences_for_user(lists, user) - return unless user - - lists.each { |list| list.preferences_for(user) } - end - end - def preferences_for(user) return preferences.build unless user @@ -38,18 +31,6 @@ class List < ApplicationRecord end end - def update_preferences_for(user, preferences = {}) - return unless user - - preferences_for(user).update(preferences) - end - - def collapsed?(user) - preferences = preferences_for(user) - - preferences.collapsed? - end - def as_json(options = {}) super(options).tap do |json| json[:collapsed] = false |