From f9411b464dd477131540d32bed1fa8f18ef5ee4c Mon Sep 17 00:00:00 2001
From: "yuuji.yaginuma" <yuuji.yaginuma@gmail.com>
Date: Thu, 27 Nov 2014 14:36:10 +0900
Subject: Don't remove mailer layouts files

---
 actionmailer/lib/rails/generators/mailer/mailer_generator.rb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'actionmailer/lib/rails/generators/mailer')

diff --git a/actionmailer/lib/rails/generators/mailer/mailer_generator.rb b/actionmailer/lib/rails/generators/mailer/mailer_generator.rb
index 094ec85114..83f8a67da7 100644
--- a/actionmailer/lib/rails/generators/mailer/mailer_generator.rb
+++ b/actionmailer/lib/rails/generators/mailer/mailer_generator.rb
@@ -8,7 +8,9 @@ module Rails
 
       def create_mailer_file
         template "mailer.rb", File.join('app/mailers', class_path, "#{file_name}.rb")
-        template "application_mailer.rb", 'app/mailers/application_mailer.rb'
+        if self.behavior == :invoke
+          template "application_mailer.rb", 'app/mailers/application_mailer.rb'
+        end
       end
 
       hook_for :template_engine, :test_framework
-- 
cgit v1.2.3