aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2010-06-08 21:38:52 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2010-06-09 12:10:13 +0200
commit71db13152c8a9b50055a3729f54988c12fc6004d (patch)
tree353e0d83bda89db1df13082280c54ebc6bcb05fb /app/models/answer.rb
parentNotify mentors about new answers of their recruits (diff)
downloadrecruiting-webapp-71db13152c8a9b50055a3729f54988c12fc6004d.tar.gz
recruiting-webapp-71db13152c8a9b50055a3729f54988c12fc6004d.tar.bz2
recruiting-webapp-71db13152c8a9b50055a3729f54988c12fc6004d.zip
notify mentors when recruits change answers
Diffstat (limited to 'app/models/answer.rb')
-rw-r--r--app/models/answer.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/answer.rb b/app/models/answer.rb
index 406be4d..51fc39c 100644
--- a/app/models/answer.rb
+++ b/app/models/answer.rb
@@ -23,6 +23,7 @@ class Answer < ActiveRecord::Base
end
after_create :notify_new_answer
+ after_update :notify_changed_answer
multi_permission :update, :destroy do
(owned? && !reference && !approved) ||
@@ -59,4 +60,8 @@ class Answer < ActiveRecord::Base
def notify_new_answer
UserMailer.deliver_new_answer(owner.mentor, self)unless owner.mentor.nil?
end
+
+ def notify_changed_answer
+ UserMailer.deliver_changed_answer owner.mentor, self
+ end
end