diff options
author | Johan Sørensen <johan@johansorensen.com> | 2009-11-04 10:22:00 +0100 |
---|---|---|
committer | Johan Sørensen <johan@johansorensen.com> | 2009-11-04 15:23:49 +0100 |
commit | 9de7735edda923c0142e884bfa922dee2a58934c (patch) | |
tree | cc8c330100aa63a2ea43a55c4bb24a42528d106b | |
parent | 45a81b223358ce40b2085e2651563c05fe815d62 (diff) | |
download | gitorious-mainline-outdated-9de7735edda923c0142e884bfa922dee2a58934c.zip gitorious-mainline-outdated-9de7735edda923c0142e884bfa922dee2a58934c.tar.gz gitorious-mainline-outdated-9de7735edda923c0142e884bfa922dee2a58934c.tar.bz2 |
Don't mention MergeRequestVersion in the notificationcomment subject
We should always refer to it as "merge request" towards the user,
since that's the only thing he interacts with
-rw-r--r-- | app/models/comment.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/models/comment.rb b/app/models/comment.rb index ee020e7..6263431 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -47,11 +47,19 @@ class Comment < ActiveRecord::Base def deliver_notification_to(another_user) message_body = "#{user.title} commented:\n\n#{body}" - message_body << "\n\nThe status of your #{target.class.human_name.downcase} is now #{state_changed_to}" if applies_to_merge_request? and state_change + if applies_to_merge_request? + if state_change + message_body << "\n\nThe status of your #{target.class.human_name.downcase} " + message_body << "is now #{state_changed_to}" + end + subject_class_name = "merge request" + else + subject_class_name = target.class.human_name.downcase + end message = Message.new({ :sender => self.user, :recipient => another_user, - :subject => "#{user.title} commented on your #{target.class.human_name.downcase}", + :subject => "#{user.title} commented on your #{subject_class_name}", :body => message_body, :notifiable => self.target, }) |