diff options
author | Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com> | 2012-12-07 10:12:47 +0000 |
---|---|---|
committer | Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com> | 2012-12-07 10:12:47 +0000 |
commit | 4896d5c7e83bb3cc7996c5ab09441c90e7cd9ce1 (patch) | |
tree | d3fabb5ab5a156ec53e28ebf938f03ddc165815a /app/models/enumeration.rb | |
parent | 8201761e7732faa3933899653de5951dcbd6b27c (diff) | |
download | redmine-4896d5c7e83bb3cc7996c5ab09441c90e7cd9ce1.tar.gz redmine-4896d5c7e83bb3cc7996c5ab09441c90e7cd9ce1.zip |
Use lambda form in model scopes (#12499)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10949 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/enumeration.rb')
-rw-r--r-- | app/models/enumeration.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb index d3454021f..1c4a7a414 100644 --- a/app/models/enumeration.rb +++ b/app/models/enumeration.rb @@ -35,9 +35,9 @@ class Enumeration < ActiveRecord::Base validates_uniqueness_of :name, :scope => [:type, :project_id] validates_length_of :name, :maximum => 30 - scope :shared, where(:project_id => nil) - scope :sorted, order("#{table_name}.position ASC") - scope :active, where(:active => true) + scope :shared, lambda { where(:project_id => nil) } + scope :sorted, lambda { order("#{table_name}.position ASC") } + scope :active, lambda { where(:active => true) } scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)} def self.default |