diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-04-02 15:38:24 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-04-02 15:38:24 +0300 |
commit | cc773654883d34c70462eeeeb280453473c35e21 (patch) | |
tree | a246f2a4246bf34407c3ab73a353b30c319abccc /app/services/issues/reopen_service.rb | |
parent | 0d41f6f0a3ab23cee63e349eda5fb79240734dd4 (diff) | |
download | gitlab-ce-cc773654883d34c70462eeeeb280453473c35e21.tar.gz |
Create services for issue close and reopen
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/services/issues/reopen_service.rb')
-rw-r--r-- | app/services/issues/reopen_service.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/services/issues/reopen_service.rb b/app/services/issues/reopen_service.rb new file mode 100644 index 00000000000..743a5d6c4a8 --- /dev/null +++ b/app/services/issues/reopen_service.rb @@ -0,0 +1,19 @@ +module Issues + class ReopenService < BaseService + def execute(issue) + if issue.reopen + event_service.reopen_issue(issue, current_user) + create_note(issue, commit) + execute_hooks(issue) + end + + issue + end + + private + + def create_note(issue) + Note.create_status_change_note(issue, issue.project, current_user, issue.state, nil) + end + end +end |