summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/boards/issues_controller.rb4
-rw-r--r--app/models/label.rb7
2 files changed, 8 insertions, 3 deletions
diff --git a/app/controllers/boards/issues_controller.rb b/app/controllers/boards/issues_controller.rb
index 1c33f9a69d8..0d74078645a 100644
--- a/app/controllers/boards/issues_controller.rb
+++ b/app/controllers/boards/issues_controller.rb
@@ -12,10 +12,10 @@ module Boards
issues = issues.page(params[:page]).per(params[:per] || 20)
make_sure_position_is_set(issues)
issues = issues.preload(:project,
- :labels,
:milestone,
:assignees,
- :notes => [:award_emoji, :author]
+ labels: [:priorities],
+ notes: [:award_emoji, :author]
)
render json: {
diff --git a/app/models/label.rb b/app/models/label.rb
index 958141a7358..899028a01a0 100644
--- a/app/models/label.rb
+++ b/app/models/label.rb
@@ -127,7 +127,12 @@ class Label < ActiveRecord::Base
end
def priority(project)
- priorities.find_by(project: project).try(:priority)
+ priority = if priorities.loaded?
+ priorities.first { |p| p.project == project }
+ else
+ priorities.find_by(project: project)
+ end
+ priority.try(:priority)
end
def template?