From 7d20a91b2ecf0af89b3a6d3a5d4d8621114687ec Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 7 Oct 2016 09:24:57 +0100 Subject: Restore subscribe status in JSON --- app/models/issue.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/models/issue.rb') 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 -- cgit v1.2.1