diff options
Diffstat (limited to 'app/models/note.rb')
-rw-r--r-- | app/models/note.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index cbf1d0adda7..bf090a0438c 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -167,7 +167,11 @@ class Note < ActiveRecord::Base end def for_personal_snippet? - noteable_type == "Snippet" && noteable.type == 'PersonalSnippet' + noteable.is_a?(PersonalSnippet) + end + + def skip_project_check? + for_personal_snippet? end # override to return commits, which are not active record @@ -225,6 +229,10 @@ class Note < ActiveRecord::Base note.match(Banzai::Filter::EmojiFilter.emoji_pattern)[1] end + def to_ability_name + for_personal_snippet? ? 'personal_snippet' : noteable_type.underscore + end + private def keep_around_commit |