All scopes must be in lambdas

This commit is contained in:
Andrew8xx8 2013-02-12 11:16:45 +04:00
parent 9a22ac63ec
commit b5db541338
9 changed files with 22 additions and 22 deletions

View file

@ -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") }