Mercurial > hg > soundsoftware-site
diff app/models/issue_category.rb @ 511:107d36338b70 live
Merge from branch "cannam"
author | Chris Cannam |
---|---|
date | Thu, 14 Jul 2011 10:43:07 +0100 |
parents | 0c939c159af4 |
children | cbb26bc654de |
line wrap: on
line diff
--- a/app/models/issue_category.rb Thu Jun 09 16:51:06 2011 +0100 +++ b/app/models/issue_category.rb Thu Jul 14 10:43:07 2011 +0100 @@ -1,5 +1,5 @@ -# redMine - project management software -# Copyright (C) 2006 Jean-Philippe Lang +# Redmine - project management software +# Copyright (C) 2006-2011 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -24,6 +24,8 @@ validates_uniqueness_of :name, :scope => [:project_id] validates_length_of :name, :maximum => 30 + named_scope :named, lambda {|arg| { :conditions => ["LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip]}} + alias :destroy_without_reassign :destroy # Destroy the category