Commit fced9678eae29864a1062a3d977cc611790a1a69
Exists in
master
and in
4 other branches
Merge pull request #1694 from robbkidd/fix_notification_of_wall_notes
Fix notification for notes on a wall. (regression)
Showing
2 changed files
with
3 additions
and
2 deletions
Show diff stats
app/observers/note_observer.rb
... | ... | @@ -16,7 +16,8 @@ class NoteObserver < ActiveRecord::Observer |
16 | 16 | protected |
17 | 17 | |
18 | 18 | def notify_team_of_new_note(note) |
19 | - notify_method = 'note_' + note.noteable_type.underscore + '_email' | |
19 | + note_is_on = note.noteable_type || 'Wall' | |
20 | + notify_method = 'note_' + note_is_on.underscore + '_email' | |
20 | 21 | |
21 | 22 | if Notify.respond_to? notify_method |
22 | 23 | team_without_note_author(note).map do |u| | ... | ... |
spec/observers/note_observer_spec.rb
... | ... | @@ -80,7 +80,7 @@ describe NoteObserver do |
80 | 80 | subject.send(:notify_team_of_new_note, note) |
81 | 81 | end |
82 | 82 | it 'a wall' do |
83 | - note.stub(:noteable_type).and_return('Wall') | |
83 | + note.stub(:noteable_type).and_return(nil) | |
84 | 84 | Notify.should_receive(:note_wall_email).twice.and_return(double(deliver: true)) |
85 | 85 | |
86 | 86 | subject.send(:notify_team_of_new_note, note) | ... | ... |