change prepend_before_action to before_action#172
Open
jaspervandenberg wants to merge 1 commit intoHoudini:masterfrom
Open
change prepend_before_action to before_action#172jaspervandenberg wants to merge 1 commit intoHoudini:masterfrom
jaspervandenberg wants to merge 1 commit intoHoudini:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
authenticate_scope!has been prepended to the callbacks list. It is not required to prepend this function and it sometimes even breaks some functionalities because it is prepended:We have a default scope on our resource model that sets a tenant according to the domain name (using: https://github.com/ErwinM/acts_as_tenant). Setting the tenant value required for finding the correct user is done in a
prepend_before_actionof our own. Because of the default scope, the `authenticate_scope! method is not able to find the correct user, because the tenant has not been set yet.I think that changing the
prepend_before_actiontobefore_actionwould be better as the developer is able to change scopes and perform other actions before the user lookup is done inauthenticate_scope!.