Sam 山
Sam 山

Reputation: 42865

Rails: update_attribut wihout validation - like object.save(false)

I trying to update a model on a callback but the validation is causing some havic and I'm controller the material getting saved so I'm looking for way to do update attributes without a validation and I would like to keep it on the update method not on validations for example :conditions =>

Something like this?

easy_address.update_attributes(some_attributes)(false)

Upvotes: 0

Views: 294

Answers (1)

clyfe
clyfe

Reputation: 23770

I belive that is:

easy_address.update_attributes_without_validation(some_attributes) # o_0

I might be wrong. If it does not work try:

easy_address.send(:attributes=, some_attributes)
easy_address.save(false)

Upvotes: 1

Related Questions