diff options
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 6141780a5..d7ef5eded 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -265,9 +265,11 @@ class Issue < ActiveRecord::Base # Copies attributes from another issue, arg can be an id or an Issue def copy_from(arg, options={}) issue = arg.is_a?(Issue) ? arg : Issue.visible.find(arg) - self.attributes = issue.attributes.dup.except("id", "root_id", "parent_id", "lft", "rgt", "created_on", "updated_on", "closed_on") + self.attributes = issue.attributes.dup.except("id", "root_id", "parent_id", "lft", "rgt", "created_on", "updated_on", "status_id", "closed_on") self.custom_field_values = issue.custom_field_values.inject({}) {|h,v| h[v.custom_field_id] = v.value; h} - self.status = issue.status + if options[:keep_status] + self.status = issue.status + end self.author = User.current unless options[:attachments] == false self.attachments = issue.attachments.map do |attachement| @@ -973,10 +975,6 @@ class Issue < ActiveRecord::Base statuses << initial_status unless statuses.empty? statuses << default_status if include_default || (new_record? && statuses.empty?) - if new_record? && @copied_from - statuses << @copied_from.status - end - statuses = statuses.compact.uniq.sort if blocked? || descendants.open.any? # cannot close a blocked issue or a parent with open subtasks |