diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-15 11:35:40 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-17 07:39:16 +0100 |
commit | 15d32b6a11380c257180dbc8e2691bc12e2792bc (patch) | |
tree | 9be5edc43e8ca447a79c000841b574b034c4d946 /app/services/issues | |
parent | a23f0e8c9ebd3a7922786d2fc4f3450c1fdecad6 (diff) | |
download | gitlab-ce-15d32b6a11380c257180dbc8e2691bc12e2792bc.tar.gz |
Add new notifications for issue move action
[ci skip]
Diffstat (limited to 'app/services/issues')
-rw-r--r-- | app/services/issues/move_service.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/services/issues/move_service.rb b/app/services/issues/move_service.rb index e2089e22bcb..4abcd203407 100644 --- a/app/services/issues/move_service.rb +++ b/app/services/issues/move_service.rb @@ -10,13 +10,17 @@ module Issues if new_project_id @project_new = Project.find(new_project_id) end + + if @project_new == @project_old + raise StandardError, 'Cannot move issue to project it originates from!' + end end def execute return unless move? - # Using trasaction because of a high footprint on - # rewriting notes (unfolding references) + # Using trasaction because of a high resources footprint + # on rewriting notes (unfolding references) # ActiveRecord::Base.transaction do # New issue tasks @@ -99,6 +103,7 @@ module Issues end def notify_participants + notification_service.issue_moved(@issue_old, @issue_new, @current_user) end end end |