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

@ -29,7 +29,7 @@ class Namespace < ActiveRecord::Base
after_update :move_dir
after_destroy :rm_dir
scope :root, where('type IS NULL')
scope :root, -> { where('type IS NULL') }
def self.search query
where("name LIKE :query OR path LIKE :query", query: "%#{query}%")