ActiveModel callbacks

Hi,

I’ve set up several ActiveModel callbacks an run them via

_run_whatever_callbacks do
… some code
end

Now i would like to run the before_whatever and after_whatever
independently, aka
_run_before_whatever_callbacks. Is that somehow possible?

I need that for running the callbacks on a set ob sub-objects, and i
dont know how to nest the blocks dynamically (without any crazy hacks
:-).

in short, I’d like to do something like that:

subobjects.each { |obj| obj._run_before_whatever_callbacks }
… some code
subobjects.each { |obj| obj._run_after_whatever_callbacks }

Thanks,
Robert

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs