summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobb Kidd <robb@thekidds.org>2012-05-15 19:36:48 -0400
committerRobb Kidd <robb@thekidds.org>2012-05-15 22:37:34 -0400
commit39061af9f8f19d114b48f79a66c22116a52e57be (patch)
treebed3795b6de0b1effdcdb61aeddcf5764fb24019
parent2d124d9496ea2bca71a25a29a4301cc718b5001c (diff)
downloadgitlab-ce-39061af9f8f19d114b48f79a66c22116a52e57be.tar.gz
Make Notify#new_issue_email resque friendly.
-rw-r--r--app/mailers/notify.rb9
-rw-r--r--app/views/notify/new_issue_email.html.haml2
-rw-r--r--spec/mailers/notify_spec.rb2
3 files changed, 5 insertions, 8 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index a4ffd97fb7c..b776878b03b 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -13,12 +13,9 @@ class Notify < ActionMailer::Base
mail(:to => @user.email, :subject => "gitlab | Account was created for you")
end
- def new_issue_email(issue)
- @issue = Issue.find(issue['id'])
- @user = @issue.assignee
- @project = @issue.project
-
- mail(:to => @user.email, :subject => "gitlab | New Issue was created")
+ def new_issue_email(issue_id)
+ @issue = Issue.find(issue_id)
+ mail(:to => @issue.assignee_email, :subject => "gitlab | New Issue was created")
end
def note_wall_email(recipient_id, note_id)
diff --git a/app/views/notify/new_issue_email.html.haml b/app/views/notify/new_issue_email.html.haml
index 64c5aa611eb..dd6f50c0686 100644
--- a/app/views/notify/new_issue_email.html.haml
+++ b/app/views/notify/new_issue_email.html.haml
@@ -10,7 +10,7 @@
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"}
%h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
- = link_to project_issue_url(@project, @issue), :title => @issue.title do
+ = link_to project_issue_url(@issue.project, @issue), :title => @issue.title do
= "Issue ##{@issue.id.to_s}"
= truncate(@issue.title, :length => 45)
%br
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 60c8c8ab9a0..40a51437908 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -59,7 +59,7 @@ describe Notify do
let(:issue) { Factory.create(:issue, :assignee => assignee, :project => project ) }
describe 'that are new' do
- subject { Notify.new_issue_email(issue) }
+ subject { Notify.new_issue_email(issue.id) }
it_behaves_like 'an assignee email'