Patch #24837 » author.diff
| app/controllers/issues_controller.rb | ||
|---|---|---|
|
@issues.reject! {|issue| @issues.detect {|other| issue.is_descendant_of?(other)}}
|
||
|
end
|
||
|
@assignee_to_author = true if attributes['assigned_to_id'].present? && attributes['assigned_to_id'] == 'author'
|
||
|
@issues.each do |orig_issue|
|
||
|
orig_issue.reload
|
||
|
if @copy
|
||
| ... | ... | |
|
issue = orig_issue
|
||
|
end
|
||
|
journal = issue.init_journal(User.current, params[:notes])
|
||
|
if attributes['assigned_to_id'].present? && attributes['assigned_to_id'] == 'author'
|
||
|
if @assignee_to_author
|
||
|
attributes['assigned_to_id'] = issue.author_id
|
||
|
end
|
||
|
issue.safe_attributes = attributes
|
||
| test/functional/issues_controller_test.rb | ||
|---|---|---|
|
Issue.where(id: [1, 2]).each {|i| assert_equal 2, i.assigned_to_id}
|
||
|
end
|
||
|
def test_bulk_update_with_different_author
|
||
|
@request.session[:user_id] = 2
|
||
|
ids = Project.find(2).issues.map(&:id)
|
||
|
post :bulk_update, :ids => ids, :issue => {:project_id => '2', assigned_to_id: 'author'}
|
||
|
Project.find(2).issues.each {|i| assert_equal i.author_id, i.assigned_to_id}
|
||
|
end
|
||
|
def test_get_bulk_copy
|
||
|
@request.session[:user_id] = 2
|
||
|
get :bulk_edit, :ids => [1, 2, 3], :copy => '1'
|
||