summaryrefslogtreecommitdiff
path: root/app/models/note.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-06-20 19:20:39 +0200
committerDouwe Maan <douwe@selenight.nl>2016-07-06 18:50:59 -0400
commit2f30d00432e9727581e814062ea6117e1946a981 (patch)
tree06ec465690ac4e0fd6520e254c5064b21794d48a /app/models/note.rb
parentdb65954d78899f6d48a682e0c220cbb4e6f59cb8 (diff)
downloadgitlab-ce-2f30d00432e9727581e814062ea6117e1946a981.tar.gz
Add DiffNote model
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index 0c265064630..ffffd0c0838 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -56,7 +56,7 @@ class Note < ActiveRecord::Base
scope :inc_author, ->{ includes(:author) }
scope :inc_author_project_award_emoji, ->{ includes(:project, :author, :award_emoji) }
- scope :legacy_diff_notes, ->{ where(type: 'LegacyDiffNote') }
+ scope :diff_notes, ->{ where(type: ['LegacyDiffNote', 'DiffNote']) }
scope :non_diff_notes, ->{ where(type: ['Note', nil]) }
scope :with_associations, -> do
@@ -82,7 +82,7 @@ class Note < ActiveRecord::Base
end
def grouped_diff_notes
- legacy_diff_notes.select(&:active?).sort_by(&:created_at).group_by(&:line_code)
+ diff_notes.select(&:active?).sort_by(&:created_at).group_by(&:line_code)
end
# Searches for notes matching the given query.
@@ -115,6 +115,10 @@ class Note < ActiveRecord::Base
false
end
+ def new_diff_note?
+ false
+ end
+
def active?
true
end