Fix for: ActiveSupport::Callbacks: deprecate monkey patch of object callbacks.

(cherry picked from commit d4882a01307a8a41e671f05b57fa0cc2fb88b2c5)