-
Notifications
You must be signed in to change notification settings - Fork 51
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
Don't use prepend_before_action
when loading/authorizing resources
#730
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems alright to me, though I don't know how to reason about whether there'd be other unforeseen repercussions to this.
I wonder if we can explain this further in the eventual release notes? Or can we support passing prepend: true
to get the old behavior?
Yeah, this definitely strikes me as the kind of change that could definitely have unforeseen consequences. Especially because I don't really understand whatever problem people were running into. Maybe a |
Yeah, true. Sometimes these things can be a bit finicky. I suppose we could do we something like this for a before_actions = [
-> { before_action() },
-> { before_action() },
]
before_actions.reverse! if options[:prepend]
before_actions.each(&:call) I think this would be a relatively easy way to have backwardscompatibility — although it's a bit of do we want to carry this forward, versus just cutting it off and deal with the aftermath? |
🤔 Interesting proposal on using an array. But I don't fully understand how it would work. Honestly, I'm a little hesitant to merge either until we hear from someone who's experienced the problem that we're trying to fix. I still feel like I'm flying blind on this one. |
@seattlecyclist @aaricpittman Can y'all give this branch a try and see if it fixes the problem you mentioned in #531? |
Using
prepend_before_action
causes problems because developers lose the ability to control the order in which callbacks happen.Maybe fixes #531? (Hard to be sure since I don't know how to reproduce whatever problem people are running into.)
Supersedes #716