diff options
Diffstat (limited to 'app/models/issue_status.rb')
-rw-r--r-- | app/models/issue_status.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/issue_status.rb b/app/models/issue_status.rb index 5527e2c9a..f2db4b570 100644 --- a/app/models/issue_status.rb +++ b/app/models/issue_status.rb @@ -26,6 +26,8 @@ class IssueStatus < ActiveRecord::Base validates_uniqueness_of :name validates_length_of :name, :maximum => 30 validates_inclusion_of :default_done_ratio, :in => 0..100, :allow_nil => true + + named_scope :named, lambda {|arg| { :conditions => ["LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip]}} def after_save IssueStatus.update_all("is_default=#{connection.quoted_false}", ['id <> ?', id]) if self.is_default? |