From d73fbe6a63ba67f68e7e372b3b7eaa535cd7eb03 Mon Sep 17 00:00:00 2001 From: "Philip (flip) Kromer" Date: Thu, 14 Aug 2008 12:30:56 -0500 Subject: [PATCH] Fix for a change in action_mailer that dislikes .html.erb on the (non-html) email template: In rails 2.2, the activation email on account creation seems not to use the template, but instead is just the available variables crammed together. the attachment is an rspec test which I placed under spec/controllers. it passes in rails 2.1, fails in rails 2.2. see * http://rails_security.lighthouseapp.com/projects/15332/tickets/3-activation-email-template-broken-in-edgerails#ticket-3-4 * http://github.com/rails/rails/commit/b2504f8ba0f9baadb9298647fd58ef2c136f9aae Thanks to Lewis Hoffman for the findin' and the fixin' --- .../authenticated/authenticated_generator.rb | 14 +++++++------- .../{activation.html.erb => activation.erb} | 0 ...tification.html.erb => signup_notification.erb} | 0 3 files changed, 7 insertions(+), 7 deletions(-) rename generators/authenticated/templates/{activation.html.erb => activation.erb} (100%) rename generators/authenticated/templates/{signup_notification.html.erb => signup_notification.erb} (100%) diff --git a/generators/authenticated/authenticated_generator.rb b/generators/authenticated/authenticated_generator.rb index 9920798..6f7ff69 100644 --- a/generators/authenticated/authenticated_generator.rb +++ b/generators/authenticated/authenticated_generator.rb @@ -68,8 +68,8 @@ def initialize(runtime_args, runtime_options = {}) @model_controller_controller_name = @model_controller_plural_name load_or_initialize_site_keys() - - if options[:dump_generator_attribute_names] + + if options[:dump_generator_attribute_names] dump_generator_attribute_names end end @@ -233,8 +233,8 @@ def manifest if options[:include_activation] # Mailer templates %w( activation signup_notification ).each do |action| - m.template "#{action}.html.erb", - File.join('app/views', "#{file_name}_mailer", "#{action}.html.erb") + m.template "#{action}.erb", + File.join('app/views', "#{file_name}_mailer", "#{action}.erb") end end @@ -270,8 +270,8 @@ def manifest end if options[:aasm] puts "- Install the acts_as_state_machine gem:" - puts " sudo gem sources -a http://gems.github.com (If you haven't already)" - puts " sudo gem install rubyist-aasm" + puts " sudo gem sources -a http://gems.github.com (If you haven't already)" + puts " sudo gem install rubyist-aasm" elsif options[:stateful] puts "- Install the acts_as_state_machine plugin:" puts " svn export http://elitists.textdriven.com/svn/plugins/acts_as_state_machine/trunk vendor/plugins/acts_as_state_machine" @@ -391,7 +391,7 @@ def add_options!(opt) opt.on("--stateful", "Use acts_as_state_machine. Assumes --include-activation") { |v| options[:include_activation] = options[:stateful] = true } opt.on("--aasm", - "Use (gem) aasm. Assumes --include-activation") { |v| options[:include_activation] = options[:stateful] = options[:aasm] = true } + "Use (gem) aasm. Assumes --include-activation") { |v| options[:include_activation] = options[:stateful] = options[:aasm] = true } opt.on("--rspec", "Force rspec mode (checks for RAILS_ROOT/spec by default)") { |v| options[:rspec] = true } opt.on("--no-rspec", diff --git a/generators/authenticated/templates/activation.html.erb b/generators/authenticated/templates/activation.erb similarity index 100% rename from generators/authenticated/templates/activation.html.erb rename to generators/authenticated/templates/activation.erb diff --git a/generators/authenticated/templates/signup_notification.html.erb b/generators/authenticated/templates/signup_notification.erb similarity index 100% rename from generators/authenticated/templates/signup_notification.html.erb rename to generators/authenticated/templates/signup_notification.erb