Mercurial > hg > soundsoftware-site
diff app/models/enumeration.rb @ 514:7eba09d624db live
Merge
author | Chris Cannam |
---|---|
date | Thu, 14 Jul 2011 10:50:53 +0100 |
parents | 0c939c159af4 |
children | cbb26bc654de |
line wrap: on
line diff
--- a/app/models/enumeration.rb Thu Jul 14 10:46:20 2011 +0100 +++ b/app/models/enumeration.rb Thu Jul 14 10:50:53 2011 +0100 @@ -32,6 +32,7 @@ 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