Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-15 02:51:41 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 19:58:27 +0300
commit86e0b5d643df21503281115774da550e06a4e878 (patch)
tree1231f7b86bec02aa6a9663a6ec5cc7cefdbed4a0 /app/models/list.rb
parent3c2aaec1f2624ad4817e7ac52120985682afa448 (diff)
Fix issue board related controllers to expose label priority per project
Diffstat (limited to 'app/models/list.rb')
-rw-r--r--app/models/list.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/list.rb b/app/models/list.rb
index eb87decdbc8..065d75bd1dc 100644
--- a/app/models/list.rb
+++ b/app/models/list.rb
@@ -26,6 +26,17 @@ class List < ActiveRecord::Base
label? ? label.name : list_type.humanize
end
+ def as_json(options = {})
+ super(options).tap do |json|
+ if options.has_key?(:label)
+ json[:label] = label.as_json(
+ project: board.project,
+ only: [:id, :title, :description, :color]
+ )
+ end
+ end
+ end
+
private
def can_be_destroyed