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
Tatuya Kamada
gitlab-ce
Commits
991d23e2
Commit
991d23e2
authored
May 15, 2012
by
Robb Kidd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change calls to Notify methods to send IDs instead of objects.
parent
e660043d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
app/models/mailer_observer.rb
app/models/mailer_observer.rb
+7
-7
No files found.
app/models/mailer_observer.rb
View file @
991d23e2
...
@@ -18,7 +18,7 @@ class MailerObserver < ActiveRecord::Observer
...
@@ -18,7 +18,7 @@ class MailerObserver < ActiveRecord::Observer
def
new_issue
(
issue
)
def
new_issue
(
issue
)
if
issue
.
assignee
!=
current_user
if
issue
.
assignee
!=
current_user
Notify
.
new_issue_email
(
issue
).
deliver
Notify
.
new_issue_email
(
issue
.
id
).
deliver
end
end
end
end
...
@@ -32,26 +32,26 @@ class MailerObserver < ActiveRecord::Observer
...
@@ -32,26 +32,26 @@ class MailerObserver < ActiveRecord::Observer
note
.
project
.
users
.
reject
{
|
u
|
u
.
id
==
current_user
.
id
}
.
each
do
|
u
|
note
.
project
.
users
.
reject
{
|
u
|
u
.
id
==
current_user
.
id
}
.
each
do
|
u
|
case
note
.
noteable_type
case
note
.
noteable_type
when
"Commit"
then
when
"Commit"
then
Notify
.
note_commit_email
(
u
,
note
).
deliver
Notify
.
note_commit_email
(
u
.
id
,
note
.
id
).
deliver
when
"Issue"
then
when
"Issue"
then
Notify
.
note_issue_email
(
u
,
note
).
deliver
Notify
.
note_issue_email
(
u
.
id
,
note
.
id
).
deliver
when
"MergeRequest"
then
when
"MergeRequest"
then
Notify
.
note_merge_request_email
(
u
.
id
,
note
.
id
).
deliver
Notify
.
note_merge_request_email
(
u
.
id
,
note
.
id
).
deliver
when
"Snippet"
when
"Snippet"
true
true
else
else
Notify
.
note_wall_email
(
u
,
note
).
deliver
Notify
.
note_wall_email
(
u
.
id
,
note
.
id
).
deliver
end
end
end
end
# Notify only author of resource
# Notify only author of resource
elsif
note
.
notify_author
elsif
note
.
notify_author
Notify
.
note_commit_email
(
note
.
commit_author
,
note
).
deliver
Notify
.
note_commit_email
(
note
.
commit_author
.
id
,
note
.
id
).
deliver
end
end
end
end
def
new_merge_request
(
merge_request
)
def
new_merge_request
(
merge_request
)
if
merge_request
.
assignee
!=
current_user
if
merge_request
.
assignee
!=
current_user
Notify
.
new_merge_request_email
(
merge_request
).
deliver
Notify
.
new_merge_request_email
(
merge_request
.
id
).
deliver
end
end
end
end
...
@@ -61,7 +61,7 @@ class MailerObserver < ActiveRecord::Observer
...
@@ -61,7 +61,7 @@ class MailerObserver < ActiveRecord::Observer
recipients_ids
.
delete
current_user
.
id
recipients_ids
.
delete
current_user
.
id
User
.
find
(
recipients_ids
).
each
do
|
user
|
User
.
find
(
recipients_ids
).
each
do
|
user
|
Notify
.
changed_merge_request_email
(
user
,
merge_request
).
deliver
Notify
.
reassigned_merge_request_email
(
user
.
id
,
merge_request
.
id
,
merge_request
.
assignee_id_was
).
deliver
end
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