DataMapper 1.2.0 not returning error messages

72 views
Skip to first unread message

Paul

unread,
Mar 7, 2012, 12:56:40 PM3/7/12
to DataMapper
Hi,

I recently upgraded to DataMapper 1.2.0 from 1.1.0 and I am not
getting validation error messages anymore. I still get
DataMapper::Validations::ValidationErrors in my exception but no error
messages are populated.

Any ideas as to why this happens?

Thanks,

Paul

Paul

unread,
Mar 7, 2012, 1:21:49 PM3/7/12
to DataMapper
I am using Rails 3.2.0 if it makes a difference.

Paul

unread,
Mar 8, 2012, 2:07:47 AM3/8/12
to DataMapper
Seems like in the 1.2.0 version of the datamapper, the parent/children
objects are also validated as well when saving an object. That's why
it was failing validation because one of my parent object was not
valid and no errors messages are shown because of that.

Till Schulte-Coerne

unread,
Mar 8, 2012, 4:07:47 AM3/8/12
to datam...@googlegroups.com
Hi Paul,

I wrote a little helper addressing that problem:

Just include it into you models or into DataMapper::Resource and `my_resource.all_errors` will return a nested hash of all errors in associated dirty objects. 

Till

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



Reply all
Reply to author
Forward
0 new messages