Mercurial > hg > soundsoftware-site
comparison 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 |
comparison
equal
deleted
inserted
replaced
506:1551c61843d2 | 508:851510f1b535 |
---|---|
1 # redMine - project management software | 1 # Redmine - project management software |
2 # Copyright (C) 2006 Jean-Philippe Lang | 2 # Copyright (C) 2006-2011 Jean-Philippe Lang |
3 # | 3 # |
4 # This program is free software; you can redistribute it and/or | 4 # This program is free software; you can redistribute it and/or |
5 # modify it under the terms of the GNU General Public License | 5 # modify it under the terms of the GNU General Public License |
6 # as published by the Free Software Foundation; either version 2 | 6 # as published by the Free Software Foundation; either version 2 |
7 # of the License, or (at your option) any later version. | 7 # of the License, or (at your option) any later version. |
22 | 22 |
23 validates_presence_of :name | 23 validates_presence_of :name |
24 validates_uniqueness_of :name, :scope => [:project_id] | 24 validates_uniqueness_of :name, :scope => [:project_id] |
25 validates_length_of :name, :maximum => 30 | 25 validates_length_of :name, :maximum => 30 |
26 | 26 |
27 named_scope :named, lambda {|arg| { :conditions => ["LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip]}} | |
28 | |
27 alias :destroy_without_reassign :destroy | 29 alias :destroy_without_reassign :destroy |
28 | 30 |
29 # Destroy the category | 31 # Destroy the category |
30 # If a category is specified, issues are reassigned to this category | 32 # If a category is specified, issues are reassigned to this category |
31 def destroy(reassign_to = nil) | 33 def destroy(reassign_to = nil) |