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
1 changed files with 3 additions and 3 deletions

View File

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