Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Wrap helper_method calls in respond_to?(:helper_method) #47

Closed
wants to merge 1 commit into from

Conversation

Envek
Copy link
Contributor

@Envek Envek commented May 9, 2016

Currently Monban::ControllerHelpers depends on #helper_method, which is defined inside AbstractController::Helpers. This module is included in ActionController::Base, but it is not included by default in ActionController::Metal. So it's not available in Ruby on Rails 5.0 applications in API mode (rails-api).

#helper_method is not essential to the functionality of the methods inside Monban::ControllerHelpers, so this PR wraps all #helper_method calls with respond_to?(:helper_method) checks.

See rails/rails#21067 and heartcombo/devise#3732 for reference.

Currently `Monban::ControllerHelpers` depends on `#helper_method`, which is defined inside `AbstractController::Helpers`. This module is included in `ActionController::Base`, but it is not included by default in `ActionController::Metal`. So it's not available in Ruby on Rails 5.0 applications in API mode (rails-api).

`#helper_method` is not essential to the functionality of the methods inside `Monban::ControllerHelpers`, so this PR wraps all `#helper_method` calls with `respond_to?(:helper_method)` checks.

See rails/rails#21067 and heartcombo/devise#3732 for reference.
@halogenandtoast
Copy link
Owner

I've merged this onto master. Expect a 1.0.1 release soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants