diff app/models/.svn/text-base/issue_category.rb.svn-base @ 508:851510f1b535 cannam

Merge from branch "redmine-1.2"
author Chris Cannam
date Thu, 14 Jul 2011 10:37:36 +0100
parents 0c939c159af4
children
line wrap: on
line diff
--- a/app/models/.svn/text-base/issue_category.rb.svn-base	Thu Jul 14 10:21:43 2011 +0100
+++ b/app/models/.svn/text-base/issue_category.rb.svn-base	Thu Jul 14 10:37:36 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