Permalink
Browse files

wall comment does not create an event on dashboard any more

  • Loading branch information...
1 parent b1bd3f1 commit ba4f0abf47940f27160166500979f6bcbd797d45 @randx randx committed Mar 19, 2013
Showing with 7 additions and 5 deletions.
  1. +1 −2 app/helpers/notes_helper.rb
  2. +6 −3 app/observers/activity_observer.rb
@@ -1,8 +1,7 @@
module NotesHelper
# Helps to distinguish e.g. commit notes in mr notes list
def note_for_main_target?(note)
- note.for_wall? ||
- (@target_type.camelize == note.noteable_type && !note.for_diff_line?)
+ (@target_type.camelize == note.noteable_type && !note.for_diff_line?)
end
def note_target_fields
@@ -4,9 +4,12 @@ class ActivityObserver < ActiveRecord::Observer
def after_create(record)
event_author_id = record.author_id
- # Skip status notes
- if record.kind_of?(Note) && record.note.include?("_Status changed to ")
- return true
+ if record.kind_of?(Note)
+ # Skip system status notes like 'status changed to close'
+ return true if record.note.include?("_Status changed to ")
+
+ # Skip wall notes to prevent spaming of dashboard
+ return true if record.noteable_type.blank?
end
if event_author_id

0 comments on commit ba4f0ab

Please sign in to comment.