@@ -775,15 +775,13 class Project < ActiveRecord::Base | |||
|
775 | 775 | new_issue = Issue.new |
|
776 | 776 | new_issue.copy_from(issue, :subtasks => false) |
|
777 | 777 | new_issue.project = self |
|
778 | # Reassign fixed_versions by name, since names are unique per | |
|
779 | # project and the versions for self are not yet saved | |
|
778 | # Reassign fixed_versions by name, since names are unique per project | |
|
780 | 779 | if issue.fixed_version |
|
781 |
new_issue.fixed_version = self.versions. |
|
|
780 | new_issue.fixed_version = self.versions.detect {|v| v.name == issue.fixed_version.name} | |
|
782 | 781 | end |
|
783 | # Reassign the category by name, since names are unique per | |
|
784 | # project and the categories for self are not yet saved | |
|
782 | # Reassign the category by name, since names are unique per project | |
|
785 | 783 | if issue.category |
|
786 |
new_issue.category = self.issue_categories. |
|
|
784 | new_issue.category = self.issue_categories.detect {|c| c.name == issue.category.name} | |
|
787 | 785 | end |
|
788 | 786 | # Parent issue |
|
789 | 787 | if issue.parent_id |
General Comments 0
You need to be logged in to leave comments.
Login now