Searched for it, but found nothing, so i open a new topic
I think it is very basic stuff…
My model has a validation rule like this:
If i try to save the model (@mymodel.save) with an empty title-formfield
i get an error. hooray! that’s what i want!
okay i insert a valid title and everything is fine.
now i want to update the model (@mymodel.update) and - SURPRISE! - now
i can update title to an empty string “”! Why?
Even if i have this in my rule
validates_presence_of :title, :on => :update
i can update my model without an error and have an empty string for the
title in my database.
i dont get it. the API says:
Finds the record from the passed id, instantly saves it with the passed
attributes (if the validation permits it), and returns it.
but it does not validate!!
i’m using rails 1.1.2