New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regenerate application_mailer.rb if it is missing #24161

Merged
merged 2 commits into from Mar 12, 2016

Conversation

Projects
None yet
5 participants
@Sen-Zhang
Contributor

Sen-Zhang commented Mar 12, 2016

fix for #24160

@rails-bot

This comment has been minimized.

rails-bot commented Mar 12, 2016

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @arthurnn (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@@ -9,6 +9,10 @@ class MailerGenerator < NamedBase
def create_mailer_file
template "mailer.rb", File.join('app/mailers', class_path, "#{file_name}_mailer.rb")
unless File.exist?('app/mailers/application_mailer.rb')

This comment has been minimized.

@rafaelfranca

rafaelfranca Mar 12, 2016

Member

This needs to run inside in_root block

@@ -9,6 +9,10 @@ class MailerGenerator < NamedBase
def create_mailer_file
template "mailer.rb", File.join('app/mailers', class_path, "#{file_name}_mailer.rb")
unless File.exist?('app/mailers/application_mailer.rb')
template 'application_mailer.rb', 'app/mailers/application_mailer.rb'

This comment has been minimized.

@rafaelfranca

rafaelfranca Mar 12, 2016

Member

This should only run in behavior is :invoke

@Sen-Zhang

This comment has been minimized.

Contributor

Sen-Zhang commented Mar 12, 2016

@rafaelfranca how about now?

rafaelfranca added a commit that referenced this pull request Mar 12, 2016

Merge pull request #24161 from Sen-Zhang/restore_application_mailer
regenerate application_mailer.rb if it is missing

@rafaelfranca rafaelfranca merged commit 66afa81 into rails:master Mar 12, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

prathamesh-sonpatki added a commit to prathamesh-sonpatki/rails that referenced this pull request Mar 12, 2016

y-yagi added a commit to y-yagi/rails that referenced this pull request May 14, 2016

generate mailer layout files if it does not already exist
Currently, if `ApplicationMailer` does not exist, it is generated when
run the mailer generator, but layouts files does not generate.
However, because it uses the layouts in `ApplicationMailer`,
layouts are required.

Follow up to rails#24161

y-yagi added a commit to y-yagi/rails that referenced this pull request Sep 8, 2016

generate mailer layout files if it does not already exist
Currently, if `ApplicationMailer` does not exist, it is generated when
run the mailer generator, but layouts files does not generate.
However, because it uses the layouts in `ApplicationMailer`,
layouts are required.

Follow up to rails#24161
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment