Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
43cad71f
Commit
43cad71f
authored
Aug 29, 2012
by
Alex Denisov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Duplicate code removed from IssueObserver#after_update
parent
2cb0a62f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
app/observers/issue_observer.rb
app/observers/issue_observer.rb
+6
-10
No files found.
app/observers/issue_observer.rb
View file @
43cad71f
...
...
@@ -10,17 +10,13 @@ class IssueObserver < ActiveRecord::Observer
def
after_update
(
issue
)
send_reassigned_email
(
issue
)
if
issue
.
is_being_reassigned?
if
issue
.
is_being_closed?
Note
.
create_status_change_note
(
issue
,
current_user
,
'closed'
)
status
=
nil
status
=
'closed'
if
issue
.
is_being_closed?
status
=
'reopened'
if
issue
.
is_being_reopened?
if
status
Note
.
create_status_change_note
(
issue
,
current_user
,
status
)
[
issue
.
author
,
issue
.
assignee
].
compact
.
each
do
|
recipient
|
Notify
.
issue_status_changed_email
(
recipient
.
id
,
issue
.
id
,
'closed'
,
current_user
)
end
end
if
issue
.
is_being_reopened?
Note
.
create_status_change_note
(
issue
,
current_user
,
'reopened'
)
[
issue
.
author
,
issue
.
assignee
].
compact
.
each
do
|
recipient
|
Notify
.
issue_status_changed_email
(
recipient
.
id
,
issue
.
id
,
'reopened'
,
current_user
)
Notify
.
issue_status_changed_email
(
recipient
.
id
,
issue
.
id
,
status
,
current_user
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment