Add the ability to choose when commands are run#89
Add the ability to choose when commands are run#89mansakondo wants to merge 1 commit intohopsoft:mainfrom
Conversation
a6ed9fd to
92c5e8c
Compare
92c5e8c to
a27f408
Compare
|
I like this idea, but can't you achieve the same behavior by simply moving where/when you include Another approach would be to use |
|
Thanks for taking the time to look at this. The config option is not needed if you're ok with not including the module by default, which would require users to include it manually. Otherwise, the config option would allow users to prevent the default behavior ( Using Before: class ApplicationController < ActionController::Base
before_action :action1
before_action :action2
before_action :action3
endAfter: class ApplicationController < ActionController::Base
prepend_before_action :action3
prepend_before_action :action2
prepend_before_action :action1
end |
Summary
By default, commands are run before existing
before_actioncallbacks (asTurboBoost::Commands::Controlleris automatically included inActionController::Base). This PR allows configuring this behavior to have more control over when commands are run:Then, we can include
TurboBoost::Commands::Controllermanually where we want it: