Copy attachments on issue and project copy (#3055).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8676 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-01-20 17:56:28 +00:00
parent e347fba11a
commit 8a3623733f
5 changed files with 110 additions and 4 deletions
+3
View File
@@ -135,6 +135,9 @@ class Issue < ActiveRecord::Base
self.custom_field_values = issue.custom_field_values.inject({}) {|h,v| h[v.custom_field_id] = v.value; h}
self.status = issue.status
self.author = User.current
self.attachments = issue.attachments.map do |attachement|
attachement.copy(:container => self)
end
@copied_from = issue
self
end