diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-16 10:24:44 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-17 07:39:16 +0100 |
commit | 5e3c9475a9332d7104a791f7bdfef30e069dd848 (patch) | |
tree | 780f1e5eb121d411ccfec0d9eaa66c7b41e97cb6 /app/services/system_note_service.rb | |
parent | 1dd279d83335de71c69d0acfdcdd7eb0ebe7f3dd (diff) | |
download | gitlab-ce-5e3c9475a9332d7104a791f7bdfef30e069dd848.tar.gz |
Add minor improvements in code related to issue move
Diffstat (limited to 'app/services/system_note_service.rb')
-rw-r--r-- | app/services/system_note_service.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb index a8d6555dec3..c679891b07c 100644 --- a/app/services/system_note_service.rb +++ b/app/services/system_note_service.rb @@ -3,7 +3,6 @@ # Used for creating system notes (e.g., when a user references a merge request # from an issue, an issue's assignee changes, an issue is closed, etc.) class SystemNoteService - extend GitlabMarkdownHelper # Called when commits are added to a Merge Request # # noteable - Noteable object @@ -398,16 +397,15 @@ class SystemNoteService # # Example Note text: # - # "Moved to project_new/#11" + # "Moved to some_namespace/project_new#11" # # Returns the created Note object - def self.noteable_moved(direction, noteable, project, noteable_ref, author) + def self.noteable_moved(noteable, project, noteable_ref, author, direction:) unless [:to, :from].include?(direction) - raise StandardError, "Invalid direction `#{direction}`" + raise ArgumentError, "Invalid direction `#{direction}`" end - cross_reference = cross_project_reference(noteable_ref.project, noteable_ref) - + cross_reference = noteable_ref.to_reference(project) body = "Moved #{direction} #{cross_reference}" create_note(noteable: noteable, project: project, author: author, note: body) end |