ruby - Rails models with before/after filters and observers, is it possible to ignore these hooks? -
if model has before/after hooks, , possibly observers other events, possible somehow perform save/update operation on model , skip any/all of these hooks fire?
e.g. perform save, , somehow tell model ignore after_save events, , don't notify observer of save don't want fire whatever usuall does.
you can use skip_callback method not execute callbacks. eg:
user.skip_callback("create",:after,:send_confirmation_email) skip callback name send_confirmation_email configured on after_create.
you can set same by: user.set_callback("create",:after,:send_confirmation_email)
Comments
Post a Comment