Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7798cf15
Commit
7798cf15
authored
Jul 14, 2020
by
Arturo Herrero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Label.by_ids method
This method is already implemented as id_in in ApplicationRecord class.
parent
1c95ebb6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
6 deletions
+2
-6
app/models/concerns/analytics/cycle_analytics/stage.rb
app/models/concerns/analytics/cycle_analytics/stage.rb
+1
-1
app/models/label.rb
app/models/label.rb
+0
-4
app/services/labels/available_labels_service.rb
app/services/labels/available_labels_service.rb
+1
-1
No files found.
app/models/concerns/analytics/cycle_analytics/stage.rb
View file @
7798cf15
...
...
@@ -125,7 +125,7 @@ module Analytics
def
label_available_for_group?
(
label_id
)
LabelsFinder
.
new
(
nil
,
{
group_id:
group
.
id
,
include_ancestor_groups:
true
,
only_group_labels:
true
})
.
execute
(
skip_authorization:
true
)
.
by_ids
(
label_id
)
.
id_in
(
label_id
)
.
exists?
end
end
...
...
app/models/label.rb
View file @
7798cf15
...
...
@@ -149,10 +149,6 @@ class Label < ApplicationRecord
1
end
def
self
.
by_ids
(
ids
)
where
(
id:
ids
)
end
def
self
.
on_project_board?
(
project_id
,
label_id
)
return
false
if
label_id
.
blank?
...
...
app/services/labels/available_labels_service.rb
View file @
7798cf15
...
...
@@ -34,7 +34,7 @@ module Labels
return
[]
if
ids
.
empty?
# 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
ids
.
map
(
&
:to_i
)
&
existing_ids
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment