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

Ignore loading helper in API-based controller #347

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

mitsuru
Copy link
Contributor

@mitsuru mitsuru commented Oct 3, 2023

If a controller based on ActionController::API exists, it no longer works with devise-i18n 1.11.1.
The API does not use view helper, so I have changed it to not load it if the helper method is not present

NoMethodError:
  undefined method `helper' for ActionController::API:Class
# /usr/local/bundle/gems/devise-i18n-1.11.1/lib/devise-i18n/railtie.rb:9:in `block (2 levels) in <class:Engine>'
# /usr/local/bundle/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
# /usr/local/bundle/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
# /usr/local/bundle/gems/doorkeeper-5.6.6/lib/doorkeeper/config.rb:477:in `resolve_controller'
# /usr/local/bundle/gems/doorkeeper-5.6.6/app/controllers/doorkeeper/application_metal_controller.rb:5:in `<module:Doorkeeper>'
# /usr/local/bundle/gems/doorkeeper-5.6.6/app/controllers/doorkeeper/application_metal_controller.rb:3:in `<top (required)>'
... snip ...

@JasonBarnabe JasonBarnabe merged commit 93f2d2c into tigrish:master Oct 4, 2023
4 checks passed
@JasonBarnabe
Copy link
Collaborator

Thanks!

@JasonBarnabe
Copy link
Collaborator

Included in 1.12.0.

@mitsuru mitsuru deleted the fix-load_helpers branch October 4, 2023 01:34
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.

2 participants