All scopes must be in lambdas
This commit is contained in:
parent
9a22ac63ec
commit
b5db541338
9 changed files with 22 additions and 22 deletions
|
@ -43,8 +43,8 @@ class Note < ActiveRecord::Base
|
|||
|
||||
# Scopes
|
||||
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 :inline, -> { where("line_code IS NOT NULL") }
|
||||
scope :not_inline, -> { where("line_code IS NULL") }
|
||||
|
||||
scope :common, ->{ where(noteable_type: ["", nil]) }
|
||||
scope :fresh, ->{ order("created_at ASC, id ASC") }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue