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

Add test for :skip_after_callbacks_if_terminated #18031

Merged

Conversation

claudiob
Copy link
Member

define_callbacks from ActiveSupport::Callbacks accepts the
:skip_after_callbacks_if_terminated option since #4866 but the option
is not tested anywhere.

This commit adds tests and fixes documentation for the option, making it clear
that halting a callback chain only stops further before_ and around_
callbacks by default.

By default, after_ callbacks are not halted.

`define_callbacks` from `ActiveSupport::Callbacks` accepts the
`:skip_after_callbacks_if_terminated` option since rails#4866 but the option
is not tested anywhere.

This commit adds tests and fixes documentation for the option, making it clear
that halting a callback chain only stops following `before_` and `around_`
callbacks by default.
@rafaelfranca
Copy link
Member

If any before callback halts, is the event executed? If not I'd expect to after callbacks being stopped too.

@rafaelfranca
Copy link
Member

Test seems good but I'd revisit this default

rafaelfranca added a commit that referenced this pull request Dec 16, 2014
…rminator

Add test for `:skip_after_callbacks_if_terminated`
@rafaelfranca rafaelfranca merged commit 43ab543 into rails:master Dec 16, 2014
@claudiob
Copy link
Member Author

@rafaelfranca said:

Test seems good but I'd revisit this default

I believe that is the same thing that @dhh said in this comment:

Ultimately, I think you should be able to halt the after_* chain as well. But we don’t need to deal with it in the same PR.

I agree that it's a good point, but I think we can deal with that after #17227 is merged, right? :)

@rafaelfranca
Copy link
Member

Sure. We also need a good upgrade path or it may be a huge problem when upgrading.

@claudiob claudiob deleted the better-tests-for-callbacks-terminator branch December 16, 2014 18:00
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

2 participants