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

Support injecting helpers into ActionController::API #133

Merged
merged 1 commit into from Jul 9, 2018
Merged

Support injecting helpers into ActionController::API #133

merged 1 commit into from Jul 9, 2018

Conversation

andrewhood125
Copy link
Contributor

Rails API apps use the lighter alternative to ActionController::Base.
This adds support for injecting these helpers into either action
controller base class that the consuming application happens to inherit
from.

This is a step towards full support in rails api mode.

ActionController::Base.helper_method :current_user
ActionController::Base.helper_method :logged_in?
ActiveSupport.on_load('action_controller') do
self.send(:include, Sorcery::Controller)
Copy link
Contributor

Choose a reason for hiding this comment

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

self. is redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

Rails API apps use the lighter alternative to ActionController::Base.
This adds support for injecting these helpers into either action
controller base class that the consuming application happens to inherit
from.
@Ch4s3 Ch4s3 merged commit 2fea1d7 into Sorcery:master Jul 9, 2018
@andrewhood125 andrewhood125 deleted the feature/support-multiple-action-controller-classes branch July 9, 2018 21:18
@joshbuker
Copy link
Member

It appears this broke master:

NoMethodError: undefined method `external_providers' for Sorcery::Controller::Config:Module

Opening a PR to fix this.

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

4 participants