summaryrefslogtreecommitdiff
path: root/app/models/label.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/label.rb')
-rw-r--r--app/models/label.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/app/models/label.rb b/app/models/label.rb
index e97e53301cc..27429e60e4a 100644
--- a/app/models/label.rb
+++ b/app/models/label.rb
@@ -34,18 +34,18 @@ class Label < ActiveRecord::Base
scope :with_title, ->(title) { where(title: title) }
def self.prioritized(project)
- joins(:priorities)
- .where(label_priorities: { project_id: project })
- .reorder('label_priorities.priority ASC, labels.title ASC')
+ joins(:priorities).
+ where(label_priorities: { project_id: project }).
+ reorder('label_priorities.priority ASC, labels.title ASC')
end
def self.unprioritized(project)
labels = Label.arel_table
priorities = LabelPriority.arel_table
- label_priorities = labels.join(priorities, Arel::Nodes::OuterJoin)
- .on(labels[:id].eq(priorities[:label_id]).and(priorities[:project_id].eq(project.id)))
- .join_sources
+ label_priorities = labels.join(priorities, Arel::Nodes::OuterJoin).
+ on(labels[:id].eq(priorities[:label_id]).and(priorities[:project_id].eq(project.id))).
+ join_sources
joins(label_priorities).where(priorities[:priority].eq(nil))
end
@@ -54,9 +54,9 @@ class Label < ActiveRecord::Base
labels = Label.arel_table
priorities = LabelPriority.arel_table
- label_priorities = labels.join(priorities, Arel::Nodes::OuterJoin)
- .on(labels[:id].eq(priorities[:label_id]))
- .join_sources
+ label_priorities = labels.join(priorities, Arel::Nodes::OuterJoin).
+ on(labels[:id].eq(priorities[:label_id])).
+ join_sources
joins(label_priorities)
end