Skip to content
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

Fix set_locale name collision in around_action filter #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kolen
Copy link

@kolen kolen commented Jun 21, 2019

subdomain_locale started to break Rails mailer previews after locale selector had been added to it. subdomain_locale sets up around action with method set_locale:

def self.included(base)
base.around_action :set_locale
end

And now Rails::MailersController also has a method named set_locale. This, for some reason, causes any requests to Rails::MailersController to render empty page.

Moved filter to filter class.

rake test:all passes.

Readme.md Outdated
@@ -90,6 +90,9 @@ rake test:all

## Changelog

master

* Fixed name collision of `set_locale` around action breaking Rails mailer previews.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added support for Rails 5.2

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added mention or Rails 5.2. Testing against 5.2 was added in #12.

Method set_locale conflicts with any controller that defines
set_locale method, in particular it breaks Rails mailer previews
because Rails::MailersController also has set_locale method.
@kolen kolen force-pushed the around-action-fix-name-collision branch from 1196728 to 14662c9 Compare June 24, 2019 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants