diff options
author | Phil Hughes <me@iamphill.com> | 2016-10-19 22:33:34 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-10-19 22:33:34 +0100 |
commit | fcf0a4a12d1ca17438a99c2b7bf334b82fa0e26e (patch) | |
tree | 8e109ee1d989f741fd7c1b0fd26cfdbf9a545b31 /app/models/list.rb | |
parent | cd5e83b6d6da3bddbc44334a1bcdbac287b35fb4 (diff) | |
parent | c08435e3c25f0a7a705ed8a49b16dde176b41a40 (diff) | |
download | gitlab-ce-fcf0a4a12d1ca17438a99c2b7bf334b82fa0e26e.tar.gz |
Merge branch 'master' into issue-board-sidebar
Diffstat (limited to 'app/models/list.rb')
-rw-r--r-- | app/models/list.rb | 11 |
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 |