Closed pronix closed 6 years ago
@domcleal please, check it.
@pronix Sorry no one has picked this up already.
I'm not sure this is the correct solution, prepend: true
will probably not be what is expected for after_create
hooks, maybe others and might even cause problems in some cases.
I'm think prepend: true
makes sense for any before_*
hook. What do you think?
hello @sean797 quote from http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html
In this case, the problem is that when the before_destroy callback is executed, the children are not available because the ActiveRecord::Base#destroy callback gets executed first. You can use the prepend option on the before_destroy callback to avoid this.
so we can working with parameters before they will deleted.
@pronix Yes, I get that, what I'm saying is if prepend: true
is set for other hooks like after_create
that could cause issues if a users hook depends on other callbacks within Foreman or plugins.
@sean797 got it. i will fix it. thanks
@sean797 check it please.
@sean797 fixed.check please.
before_destroy hooks will not receive parameters because they was deleted early. this patch call hook before delete parameters.