diff options
author | Sean McGivern <sean@gitlab.com> | 2017-07-20 17:42:33 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-07-21 14:53:56 +0300 |
commit | 1df696f5a6836e03a6bf8d5139c2c7ce6d96e727 (patch) | |
tree | ecd7c4c0ad0d3233884617d1db3afacb776ad66d /app/services/quick_actions | |
parent | 3498e825d08adb0311d0431d9d15e450f95bfc86 (diff) |
Move duplicate issue management to a service
Diffstat (limited to 'app/services/quick_actions')
-rw-r--r-- | app/services/quick_actions/interpret_service.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb index 3eecf0b5545..5dc1b91d2c0 100644 --- a/app/services/quick_actions/interpret_service.rb +++ b/app/services/quick_actions/interpret_service.rb @@ -472,6 +472,9 @@ module QuickActions end desc 'Mark this issue as a duplicate of another issue' + explanation do |duplicate_reference| + "Marks this issue as a duplicate of #{duplicate_reference}." + end params '#issue' condition do issuable.is_a?(Issue) && @@ -479,9 +482,10 @@ module QuickActions current_user.can?(:"update_#{issuable.to_ability_name}", issuable) end command :duplicate do |duplicate_param| - original_issue = extract_references(duplicate_param, :issue).first - if original_issue.present? && original_issue != issuable - @updates[:original_issue_id] = original_issue.id + canonical_issue = extract_references(duplicate_param, :issue).first + + if canonical_issue.present? + @updates[:canonical_issue_id] = canonical_issue.id end end |