OSDN Git Service

Merge commit '1.2.1' into update
[redminele/redmine.git] / app / models / enumeration.rb
index 3b7a434..71afe8f 100644 (file)
@@ -32,6 +32,7 @@ class Enumeration < ActiveRecord::Base
 
   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]}}
 
   def self.default
     # Creates a fake default scope so Enumeration.default will check