From 30eaecb3df707ec45859ab1cddb122f811c043a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 12 Jun 2010 15:33:12 +0200 Subject: subject is automatically looked up on I18n using mailer_name and action_name as scope as in t('.subject') --- actionmailer/CHANGELOG | 2 ++ actionmailer/lib/action_mailer/base.rb | 2 +- actionmailer/test/base_test.rb | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/CHANGELOG b/actionmailer/CHANGELOG index 6e2c441e53..f0b9368874 100644 --- a/actionmailer/CHANGELOG +++ b/actionmailer/CHANGELOG @@ -1,5 +1,7 @@ *Rails 3.0.0 [beta 4] (June 8th, 2010)* +* subject is automatically looked up on I18n using mailer_name and action_name as scope as in t(".subject") [JK] + * Changed encoding behaviour of mail, so updated tests in actionmailer and bumped mail version to 2.2.1 [ML] * Added ability to pass Proc objects to the defaults hash [ML] diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 7da033b6af..2e4002c39c 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -657,7 +657,7 @@ module ActionMailer #:nodoc: def default_i18n_subject #:nodoc: mailer_scope = self.class.mailer_name.gsub('/', '.') - I18n.t(:subject, :scope => [:actionmailer, mailer_scope, action_name], :default => action_name.humanize) + I18n.t(:subject, :scope => [mailer_scope, action_name], :default => action_name.humanize) end def collect_responses_and_parts_order(headers) #:nodoc: diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb index b9226196fd..88e38a583b 100644 --- a/actionmailer/test/base_test.rb +++ b/actionmailer/test/base_test.rb @@ -325,7 +325,7 @@ class BaseTest < ActiveSupport::TestCase email = BaseMailer.welcome(:subject => nil) assert_equal "Welcome", email.subject - I18n.backend.store_translations('en', :actionmailer => {:base_mailer => {:welcome => {:subject => "New Subject!"}}}) + I18n.backend.store_translations('en', :base_mailer => {:welcome => {:subject => "New Subject!"}}) email = BaseMailer.welcome(:subject => nil) assert_equal "New Subject!", email.subject end -- cgit v1.2.3