Subscribe asker to the answer

This commit is contained in:
Yuki 2015-04-21 06:58:35 +05:30
parent ecffd07344
commit 1c485b20e9

View file

@ -10,6 +10,7 @@ class Answer < ActiveRecord::Base
Notification.notify self.question.user, self unless self.question.author_is_anonymous
Subscription.subscribe self.user, self
Subscription.subscribe self.question.user, self
self.user.increment! :answered_count
self.question.increment! :answer_count
end