diff options
author | Cody Fauser <codyfauser@gmail.com> | 2008-04-21 14:31:54 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-04-21 14:31:54 -0500 |
commit | 4809dcc1b50330a04ec61dd1fef6cdba9892ac3d (patch) | |
tree | 3f2a7863b5ee389b6fb1e7b3f2bde02b3c481062 /railties | |
parent | 4ac33de4d61efe27454bbced7aece88604508bf1 (diff) | |
download | rails-4809dcc1b50330a04ec61dd1fef6cdba9892ac3d.tar.gz rails-4809dcc1b50330a04ec61dd1fef6cdba9892ac3d.tar.bz2 rails-4809dcc1b50330a04ec61dd1fef6cdba9892ac3d.zip |
* Remove default_url_options from mailer generator
* Improve mailer documentation regarding generating URLs
* Add no_match to mailer generator to warn contributors about default_url_options
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/rails_mailer_generator_test.rb | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb b/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb index 0c7e6bebaf..ce15ae9de9 100644 --- a/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb +++ b/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb @@ -1,7 +1,5 @@ class <%= class_name %> < ActionMailer::Base - # change to your domain name - default_url_options[:host] = 'example.com' <% for action in actions -%> def <%= action %>(sent_at = Time.now) diff --git a/railties/test/generators/rails_mailer_generator_test.rb b/railties/test/generators/rails_mailer_generator_test.rb index 03170c3b61..de61e6736d 100644 --- a/railties/test/generators/rails_mailer_generator_test.rb +++ b/railties/test/generators/rails_mailer_generator_test.rb @@ -17,9 +17,9 @@ class RailsMailerGeneratorTest < GeneratorTestCase ], body.split("\n").map{|line| line.sub(' '*4, '') } end - - assert_match /^ default_url_options\[:host\] = 'example.com'$/m, model, - 'model should include default_url_options :host declaration' + + assert_no_match /(self.default_url_options =|default_url_options\[.*\] =)/, model, + 'individual mailer models should not set default_url_options because the options are shared by all mailers' end assert_generated_views_for :notifier, 'reset_password.erb' |