Fixed: copying an issue keeps the author of the original issue (#6901).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5601 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
c9f31f0332
commit
88a93d7e10
|
@ -175,6 +175,7 @@ class Issue < ActiveRecord::Base
|
|||
issue.reset_custom_values!
|
||||
end
|
||||
if options[:copy]
|
||||
issue.author = User.current
|
||||
issue.custom_field_values = self.custom_field_values.inject({}) {|h,v| h[v.custom_field_id] = v.value; h}
|
||||
issue.status = if options[:attributes] && options[:attributes][:status_id]
|
||||
IssueStatus.find_by_id(options[:attributes][:status_id])
|
||||
|
|
|
@ -545,6 +545,13 @@ class IssueTest < ActiveSupport::TestCase
|
|||
|
||||
assert_equal date, @copy.due_date
|
||||
end
|
||||
|
||||
should "set current user as author" do
|
||||
User.current = User.find(9)
|
||||
@copy = @issue.move_to_project(Project.find(3), Tracker.find(2), {:copy => true, :attributes => {}})
|
||||
|
||||
assert_equal User.current, @copy.author
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue