Simplify Event's target type-checking
This commit is contained in:
parent
6286b28bbc
commit
c05ed99bff
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue