diff options
author | Phil Hughes <me@iamphill.com> | 2016-10-07 09:24:57 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-10-07 09:24:57 +0100 |
commit | 7d20a91b2ecf0af89b3a6d3a5d4d8621114687ec (patch) | |
tree | 3aceaa120558f70d525338d5ffd722c5d1b05b07 /app/models/issue.rb | |
parent | 1aff95c76844adb880e7f935deab8af5e797fb51 (diff) | |
download | gitlab-ce-7d20a91b2ecf0af89b3a6d3a5d4d8621114687ec.tar.gz |
Restore subscribe status in JSON
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index abd58e0454a..89794290520 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -274,4 +274,10 @@ class Issue < ActiveRecord::Base def check_for_spam? project.public? end + + def as_json(options = {}) + super(options).tap do |json| + json[:subscribed] = subscribed?(options[:user]) if options.has_key?(:user) + end + end end |