class Rails::Generators::MailerGenerator
def application_mailer_file_name
def application_mailer_file_name @_application_mailer_file_name ||= if mountable_engine? "app/mailers/#{namespaced_path}/application_mailer.rb" else "app/mailers/application_mailer.rb" end end
def create_mailer_file
def create_mailer_file template "mailer.rb", File.join("app/mailers", class_path, "#{file_name}_mailer.rb") in_root do if behavior == :invoke && !File.exist?(application_mailer_file_name) template "application_mailer.rb", application_mailer_file_name end end end
def file_name # :doc:
def file_name # :doc: @_file_name ||= super.sub(/_mailer\z/i, "") end