From 18ed4cf373ee87b48b9861dae8d53119d5ab7d40 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 9 Sep 2012 09:51:44 +0000 Subject: [PATCH] Code cleanup. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10332 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/project.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/models/project.rb b/app/models/project.rb index 4c4d0f9f1..e3889ff23 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -775,15 +775,13 @@ class Project < ActiveRecord::Base new_issue = Issue.new new_issue.copy_from(issue, :subtasks => false) new_issue.project = self - # Reassign fixed_versions by name, since names are unique per - # project and the versions for self are not yet saved + # Reassign fixed_versions by name, since names are unique per project if issue.fixed_version - new_issue.fixed_version = self.versions.select {|v| v.name == issue.fixed_version.name}.first + new_issue.fixed_version = self.versions.detect {|v| v.name == issue.fixed_version.name} end - # Reassign the category by name, since names are unique per - # project and the categories for self are not yet saved + # Reassign the category by name, since names are unique per project if issue.category - new_issue.category = self.issue_categories.select {|c| c.name == issue.category.name}.first + new_issue.category = self.issue_categories.detect {|c| c.name == issue.category.name} end # Parent issue if issue.parent_id