summaryrefslogtreecommitdiff
path: root/app/models/note.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index abd89a8a46e..b055ae623b2 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -42,11 +42,11 @@ class Note < ActiveRecord::Base
mount_uploader :attachment, AttachmentUploader
# Scopes
- scope :for_commits, ->{ where(noteable_type: "Commit") }
+ scope :for_commit_id, ->(commit_id) { where(noteable_type: "Commit", commit_id: commit_id) }
+ scope :inline, where("line_code IS NOT NULL")
+ scope :not_inline, where("line_code IS NULL")
+
scope :common, ->{ where(noteable_type: ["", nil]) }
- scope :today, ->{ where("created_at >= :date", date: Date.today) }
- scope :last_week, ->{ where("created_at >= :date", date: (Date.today - 7.days)) }
- scope :since, ->(day) { where("created_at >= :date", date: (day)) }
scope :fresh, ->{ order("created_at ASC, id ASC") }
scope :inc_author_project, ->{ includes(:project, :author) }
scope :inc_author, ->{ includes(:author) }