diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-02-02 17:22:55 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-02-02 17:22:55 +0900 |
commit | 5ed975507c8e88075cdc922426aa004cd5dc1f0c (patch) | |
tree | ad8f5ffd6690c906746a5ef317125246da296239 /railties | |
parent | 65bf1c60053e727835e06392d27a2fb49665484c (diff) | |
download | rails-5ed975507c8e88075cdc922426aa004cd5dc1f0c.tar.gz rails-5ed975507c8e88075cdc922426aa004cd5dc1f0c.tar.bz2 rails-5ed975507c8e88075cdc922426aa004cd5dc1f0c.zip |
generate mailer layout files only when it does not exist
If already have layout files, in many cases use it.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/erb/mailer/mailer_generator.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb index d74b5655d5..3f1d9932f6 100644 --- a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb +++ b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb @@ -12,7 +12,7 @@ module Erb # :nodoc: if behavior == :invoke formats.each do |format| layout_path = File.join("app/views/layouts", class_path, filename_with_extensions("mailer", format)) - template filename_with_extensions(:layout, format), layout_path + template filename_with_extensions(:layout, format), layout_path unless File.exist?(layout_path) end end |