diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-01-20 11:28:40 +0100 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-01-25 10:10:05 +0100 |
commit | 0c350b79395d6712c7c4fee649cdbd77aa4052cc (patch) | |
tree | 2899a67fbe65c29b84c35ab417dbec96913095c4 /app/models/note.rb | |
parent | bf708e55c2e6035b64861a1cda8bfe3d3b4a2105 (diff) | |
download | gitlab-ce-0c350b79395d6712c7c4fee649cdbd77aa4052cc.tar.gz |
address comments
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 |