Commit 5a12723b authored by Dmytro Zaporozhets's avatar Dmytro Zaporozhets

Merge branch 'remove-label-by-ids' into 'master'

Remove Label.by_ids method

See merge request gitlab-org/gitlab!36800
parents fd7bc458 7798cf15
...@@ -125,7 +125,7 @@ module Analytics ...@@ -125,7 +125,7 @@ module Analytics
def label_available_for_group?(label_id) def label_available_for_group?(label_id)
LabelsFinder.new(nil, { group_id: group.id, include_ancestor_groups: true, only_group_labels: true }) LabelsFinder.new(nil, { group_id: group.id, include_ancestor_groups: true, only_group_labels: true })
.execute(skip_authorization: true) .execute(skip_authorization: true)
.by_ids(label_id) .id_in(label_id)
.exists? .exists?
end end
end end
......
...@@ -149,10 +149,6 @@ class Label < ApplicationRecord ...@@ -149,10 +149,6 @@ class Label < ApplicationRecord
1 1
end end
def self.by_ids(ids)
where(id: ids)
end
def self.on_project_board?(project_id, label_id) def self.on_project_board?(project_id, label_id)
return false if label_id.blank? return false if label_id.blank?
......
...@@ -34,7 +34,7 @@ module Labels ...@@ -34,7 +34,7 @@ module Labels
return [] if ids.empty? return [] if ids.empty?
# rubocop:disable CodeReuse/ActiveRecord # rubocop:disable CodeReuse/ActiveRecord
existing_ids = available_labels.by_ids(ids).pluck(:id) existing_ids = available_labels.id_in(ids).pluck(:id)
# rubocop:enable CodeReuse/ActiveRecord # rubocop:enable CodeReuse/ActiveRecord
ids.map(&:to_i) & existing_ids ids.map(&:to_i) & existing_ids
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment