change prepend_before_action to before_action #172
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_action
of 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_action
tobefore_action
would be better as the developer is able to change scopes and perform other actions before the user lookup is done inauthenticate_scope!
.