lib/devise/mailers/helpers.rb in devise-2.2.0 vs lib/devise/mailers/helpers.rb in devise-2.2.1

- old
+ new

@@ -25,11 +25,11 @@ @devise_mapping ||= Devise.mappings[scope_name] end def headers_for(action, opts) headers = { - :subject => translate(devise_mapping, action), + :subject => subject_for(action), :to => resource.email, :from => mailer_sender(devise_mapping), :reply_to => mailer_reply_to(devise_mapping), :template_path => template_paths, :template_name => action @@ -84,11 +84,11 @@ # devise: # mailer: # confirmation_instructions: # subject: '...' # - def translate(mapping, key) - I18n.t(:"#{mapping.name}_subject", :scope => [:devise, :mailer, key], + def subject_for(key) + I18n.t(:"#{devise_mapping.name}_subject", :scope => [:devise, :mailer, key], :default => [:subject, key.to_s.humanize]) end end end end