diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-26 09:27:07 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-26 09:27:07 +0000 |
commit | b68fd4c04bed4d8c9f7d0ad9d65125c36635c819 (patch) | |
tree | 17b09d2a189188957923a2b149287f1c44dcfd62 /app/models | |
parent | 6ddea3396b6b477591efc2372c2f5bceb9154e5a (diff) | |
download | redmine-b68fd4c04bed4d8c9f7d0ad9d65125c36635c819.tar.gz redmine-b68fd4c04bed4d8c9f7d0ad9d65125c36635c819.zip |
When moving an issue to another project, reassign it to the category with same name if any (#1653).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1697 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/issue.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index cae603dd8..e2405a04c 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -77,7 +77,9 @@ class Issue < ActiveRecord::Base self.relations_to.clear end # issue is moved to another project - self.category = nil + # reassign to the category with same name if any + new_category = category.nil? ? nil : new_project.issue_categories.find_by_name(category.name) + self.category = new_category self.fixed_version = nil self.project = new_project end |