Simplify Event's target type-checking

This commit is contained in:
Robert Speicher 2016-05-08 14:46:43 -04:00
parent 6286b28bbc
commit c05ed99bff

View file

@ -279,15 +279,15 @@ class Event < ActiveRecord::Base
end end
def note_commit? def note_commit?
target.noteable_type == "Commit" target.for_commit?
end end
def issue_note? def issue_note?
note? && target && target.noteable_type == "Issue" note? && target && target.for_issue?
end end
def note_project_snippet? def note_project_snippet?
target.noteable_type == "Snippet" target.for_snippet?
end end
def note_target def note_target