chris
September 11, 2006, 1:33pm
1
I’d like calls to save to not use callbacks, unless specified.
I imagine it would be something like this :
def save(use_callbacks=false)
…
end
this would allow me to use callbacks if required.
What would the content of the method be? I am unsure about this.
Any help would be greately appreciated, thanks
Chris
chris
September 11, 2006, 1:56pm
2
Hi Chris
do you just want to bypass all the validations ?
If so just call instance.save(false), the method already exists.
hth
Thibaut
chris
September 11, 2006, 4:14pm
3
Thanks Thibaut.
I dont want to bypass the validations, just the callbacks.
I want to change it so that by default, .save will not use the
ActiveRecord callbacks (before_save,after_save, etc). and make it so
save(true) WILL use the callbacks.
Any ideas?
Thanks
Chris
chris
September 11, 2006, 4:16pm
4
also i want to change it so that update doesn’t call the callbacks by
default, only when called update(true). I know update_without_callbacks
exists.