Skip to content

Conversation

@arieliten
Copy link

Currently the callbacks for before_restore and before_real_destroy can't be canceled (via returning false) like any other normal ActiveModel::Callback. So here I'm adding the support to cancel any of those actions (restore or real_destroy) by returning false in their callbacks.

@rbr
Copy link
Contributor

rbr commented Feb 22, 2016

Canceling callbacks with falseseems to be deprecated in Rails 5: rails/rails#17227, throw(:abort) is the new way.

@valentindruon
Copy link

What if we are not using Rails 5.0?

@therrick
Copy link

I'd love to see this get merged. We've been using a custom fork with this change for several months now and would much rather have it in the main repo. Any outlook for accepting it?

@BenMorganIO
Copy link
Collaborator

BenMorganIO commented Jul 12, 2016

Good job @arieliten. Can you provide a test for this change?

@kasparsj
Copy link

kasparsj commented Nov 9, 2016

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants