Fix wall notes event trying to render target

This commit is contained in:
Dmitriy Zaporozhets 2012-12-16 19:52:39 +02:00
parent 592412992d
commit 5058c4fdcf
2 changed files with 16 additions and 2 deletions

View file

@ -18,4 +18,16 @@ module NoteEvent
def note_target_id
target.noteable_id
end
def wall_note?
target.noteable_type.blank?
end
def note_target_type
if target.noteable_type.present?
target.noteable_type.titleize
else
"Wall"
end.downcase
end
end