Phew, solved it. FYI, here's the solution:

It boiled down to an Integer property being set with a blank string ""
value.
The property was required=>false and the validations ignored it.
Calling my_model.valid? would return true but any attempt to call
my_model.save would then fail without reporting an error. (The model
data being submitted by the form had a hidden field with a blank
value)

Simply added a "before :valid?" hook to test property for blank string
and change it to nil. Sorted.

Hope this helps someone.
George

On Aug 24, 1:33 pm, George <[email protected]> wrote:
> Have been using the dm-ana successfully for a while now but recently
> it has started triggering validations on dozens of associations when
> previously only the main instance and those in the nested attributes
> were being validated.
>
> Presumably DM should only validate and save the dirty objects? Now it
> seems to be rather over enthusiastic, causing validation errors on
> indirectly related child objects that are not being modified.
>
> Anyone seen these symptoms before?
> Cheers,
> George

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to