From f2dd3578c08dda24093a40fe054120a5c4967f66 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 27 Jan 2010 17:34:32 -0800 Subject: self.defaults => default --- railties/lib/generators/rails/mailer/templates/mailer.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'railties') diff --git a/railties/lib/generators/rails/mailer/templates/mailer.rb b/railties/lib/generators/rails/mailer/templates/mailer.rb index cdc6e41266..ab03dd8d78 100644 --- a/railties/lib/generators/rails/mailer/templates/mailer.rb +++ b/railties/lib/generators/rails/mailer/templates/mailer.rb @@ -1,5 +1,5 @@ class <%= class_name %> < ActionMailer::Base - self.defaults :from => "from@example.com" + defaults :from => "from@example.com" <% for action in actions -%> # Subject can be set in your I18n file at config/locales/en.yml @@ -9,7 +9,8 @@ class <%= class_name %> < ActionMailer::Base # def <%= action %> @greeting = "Hi" - mail(:to => "to@example.org") + + mail :to => "to@example.org" end <% end -%> -end \ No newline at end of file +end -- cgit v1.2.3 From 079714277df4641a24513b2595c0237293f48512 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 27 Jan 2010 19:33:26 -0800 Subject: Attend to brittle mailer generator tests --- railties/test/generators/mailer_generator_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'railties') diff --git a/railties/test/generators/mailer_generator_test.rb b/railties/test/generators/mailer_generator_test.rb index 0b7f5c6817..e76ac5fb7d 100644 --- a/railties/test/generators/mailer_generator_test.rb +++ b/railties/test/generators/mailer_generator_test.rb @@ -9,7 +9,7 @@ class MailerGeneratorTest < Rails::Generators::TestCase run_generator assert_file "app/mailers/notifier.rb" do |mailer| assert_match /class Notifier < ActionMailer::Base/, mailer - assert_match /self\.defaults :from => "from@example.com"/, mailer + assert_match /defaults :from => "from@example.com"/, mailer end end @@ -61,12 +61,12 @@ class MailerGeneratorTest < Rails::Generators::TestCase assert_file "app/mailers/notifier.rb" do |mailer| assert_instance_method :foo, mailer do |foo| - assert_match /mail\(:to => "to@example.org"\)/, foo + assert_match /mail :to => "to@example.org"/, foo assert_match /@greeting = "Hi"/, foo end assert_instance_method :bar, mailer do |bar| - assert_match /mail\(:to => "to@example.org"\)/, bar + assert_match /mail :to => "to@example.org"/, bar assert_match /@greeting = "Hi"/, bar end end -- cgit v1.2.3 From 452bb1e48d7fa3dd4b2684d9d8ba3091200d59fe Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 27 Jan 2010 19:37:47 -0800 Subject: Rename 'defaults' class method to 'default' to reflect that it's a declaration --- railties/test/generators/mailer_generator_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/test/generators/mailer_generator_test.rb b/railties/test/generators/mailer_generator_test.rb index e76ac5fb7d..e6fc1bbb5c 100644 --- a/railties/test/generators/mailer_generator_test.rb +++ b/railties/test/generators/mailer_generator_test.rb @@ -9,7 +9,7 @@ class MailerGeneratorTest < Rails::Generators::TestCase run_generator assert_file "app/mailers/notifier.rb" do |mailer| assert_match /class Notifier < ActionMailer::Base/, mailer - assert_match /defaults :from => "from@example.com"/, mailer + assert_match /default :from => "from@example.com"/, mailer end end -- cgit v1.2.3 From 2c12a71378d2146c822acb389b00b866f6420ff5 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 27 Jan 2010 19:53:46 -0800 Subject: Missed template change for defaults -> default --- railties/lib/generators/rails/mailer/templates/mailer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/lib/generators/rails/mailer/templates/mailer.rb b/railties/lib/generators/rails/mailer/templates/mailer.rb index ab03dd8d78..7343eb28b3 100644 --- a/railties/lib/generators/rails/mailer/templates/mailer.rb +++ b/railties/lib/generators/rails/mailer/templates/mailer.rb @@ -1,5 +1,5 @@ class <%= class_name %> < ActionMailer::Base - defaults :from => "from@example.com" + default :from => "from@example.com" <% for action in actions -%> # Subject can be set in your I18n file at config/locales/en.yml -- cgit v1.2.3