Rewrites named scopes with ARel queries.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10950 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2012-12-07 17:59:20 +00:00
1 parent 4896d5c7e8
commit 7222e4012d
12 files changed
+55 -55

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ class Principal < ActiveRecord::Base
has_many :issue_categories, :foreign_key => 'assigned_to_id', :dependent => :nullify
# Groups and active users
scope :active, lambda { { :conditions => "#{Principal.table_name}.status = 1" } }
scope :active, lambda { where("#{Principal.table_name}.status = 1") }
scope :like, lambda {|q|
q = q.to_s