Skip to content
Browse files

Change mailer subjects lookup.

  • Loading branch information...
1 parent 83f329f commit 4a1f43878105d701fd2dd769ec3cf7e81d133c09 @josevalim josevalim committed with Yehuda Katz Nov 9, 2009
Showing with 3 additions and 3 deletions.
  1. +2 −2 actionmailer/lib/action_mailer/base.rb
  2. +1 −1 actionmailer/test/mail_service_test.rb
View
4 actionmailer/lib/action_mailer/base.rb
@@ -465,8 +465,8 @@ def create!(method_name, *parameters) #:nodoc:
create_parts
# Set the subject if not set yet
- @subject ||= I18n.t(method_name, :scope => [:actionmailer, :subjects, mailer_name],
- :default => method_name.humanize)
+ @subject ||= I18n.t(:subject, :scope => [:actionmailer, mailer_name, method_name],
+ :default => method_name.humanize)
# build the mail object itself
@mail = create_mail
View
2 actionmailer/test/mail_service_test.rb
@@ -402,7 +402,7 @@ def test_subject_with_i18n
assert_nothing_raised { TestMailer.deliver_subject_with_i18n(@recipient) }
assert_equal "Subject with i18n", ActionMailer::Base.deliveries.first.subject
- I18n.backend.store_translations('en', :actionmailer => {:subjects => {:test_mailer => {:subject_with_i18n => "New Subject!"}}})
+ I18n.backend.store_translations('en', :actionmailer => {:test_mailer => {:subject_with_i18n => {:subject => "New Subject!"}}})
assert_nothing_raised { TestMailer.deliver_subject_with_i18n(@recipient) }
assert_equal "New Subject!", ActionMailer::Base.deliveries.last.subject
end

0 comments on commit 4a1f438

Please sign in to comment.
Something went wrong with that request. Please try again.