diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-07 17:59:20 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-07 17:59:20 +0000 |
commit | 7222e4012db58c53d364e3b065e70338c094e878 (patch) | |
tree | 2d0a723b9d9030591967b9932587fb5987062ce0 /app/models/user.rb | |
parent | 4896d5c7e83bb3cc7996c5ab09441c90e7cd9ce1 (diff) | |
download | redmine-7222e4012db58c53d364e3b065e70338c094e878.tar.gz redmine-7222e4012db58c53d364e3b065e70338c094e878.zip |
Rewrites named scopes with ARel queries.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10950 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 32b7d4499..eed359fea 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -82,8 +82,8 @@ class User < Principal has_one :api_token, :class_name => 'Token', :conditions => "action='api'" belongs_to :auth_source - scope :logged, lambda { { :conditions => "#{User.table_name}.status <> #{STATUS_ANONYMOUS}" } } - scope :status, lambda {|arg| arg.blank? ? {} : {:conditions => {:status => arg.to_i}} } + scope :logged, lambda { where("#{User.table_name}.status <> #{STATUS_ANONYMOUS}") } + scope :status, lambda {|arg| where(arg.blank? ? nil : {:status => arg.to_i}) } acts_as_customizable |