summaryrefslogtreecommitdiff
path: root/app/services/issues/update_service.rb
blob: 4d8d71b4c9f7b3eaff7a5dd0de13630c6bba138e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Issues
  class UpdateService < BaseService
    def execute(issue)
      if issue.update_attributes(params)
        issue.reset_events_cache

        if issue.is_being_reassigned?
          notification_service.reassigned_issue(issue, current_user)
          create_assignee_note(issue)
        end

        issue.notice_added_references(issue.project, current_user)
        execute_hooks(issue)
      end

      issue
    end
  end
end