OSDN Git Service

Merge commit '1.2.1' into update
[redminele/redmine.git] / app / models / version.rb
index 8b01816..710074a 100644 (file)
@@ -33,6 +33,7 @@ class Version < ActiveRecord::Base
   validates_inclusion_of :status, :in => VERSION_STATUSES
   validates_inclusion_of :sharing, :in => VERSION_SHARINGS
 
+  named_scope :named, lambda {|arg| { :conditions => ["LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip]}}
   named_scope :open, :conditions => {:status => 'open'}
   named_scope :visible, lambda {|*args| { :include => :project,
                                           :conditions => Project.allowed_to_condition(args.first || User.current, :view_issues) } }