From d0d01d4e704b0d15dfd3ce2d5213ab8b5a6678fb Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 26 Apr 2012 23:51:10 +0000 Subject: model: replace Rails2 "named_scope" to Rails3 "scope" git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9537 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/enumeration.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/models/enumeration.rb') diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb index d532c78be..f1d484d88 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 - named_scope :shared, :conditions => { :project_id => nil } - named_scope :active, :conditions => { :active => true } - named_scope :named, lambda {|arg| { :conditions => ["LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip]}} + scope :shared, :conditions => { :project_id => nil } + scope :active, :conditions => { :active => true } + scope :named, lambda {|arg| { :conditions => ["LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip]}} def self.default # Creates a fake default scope so Enumeration.default will check -- cgit v1.2.3