comparison app/models/issue_category.rb @ 507:0c939c159af4 redmine-1.2

Update to Redmine 1.2.1 on 1.2-stable branch (Redmine SVN rev 6270)
author Chris Cannam
date Thu, 14 Jul 2011 10:32:19 +0100
parents 513646585e45
children cbb26bc654de
comparison
equal deleted inserted replaced
441:cbce1fd3b1b7 507:0c939c159af4
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)