If I wanted to update an attribute with calling any validation or any of
the before_save and after_save hooks, how would I go about doing this?
Supposed the update_attribute method calls the before and after save
methods.
Thanks for your help.
If I wanted to update an attribute with calling any validation or any of
the before_save and after_save hooks, how would I go about doing this?
Supposed the update_attribute method calls the before and after save
methods.
Thanks for your help.
Ben J. wrote:
If I wanted to update an attribute with calling any validation or any of
the before_save and after_save hooks, how would I go about doing this?Supposed the update_attribute method calls the before and after save
methods.Thanks for your help.
I am not sure about skipping before and after save methods, but you can
skip validation by passing true to the save method
@foo.save(true) #skips validations
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs