mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-01-31 15:29:08 +01:00
if a question was answered, all occurrences of it in the inbox are now gone
This commit is contained in:
parent
72140be316
commit
aec3e1c800
1 changed files with 2 additions and 0 deletions
|
@ -5,6 +5,8 @@ class Answer < ActiveRecord::Base
|
|||
has_many :smiles, dependent: :destroy
|
||||
|
||||
after_create do
|
||||
Inbox.where(user: self.user, question: self.question).destroy_all
|
||||
|
||||
Notification.notify self.question.user, self unless self.question.author_is_anonymous
|
||||
self.user.increment! :answered_count
|
||||
self.question.increment! :answer_count
|
||||
|
|
Loading…
Reference in a new issue