There should be a better way of doing this.  5 lines is just too much
for ruby/dm
      @errors = Hash.new
      require 'dm-validations'
      @obj.errors.each_pair do |id, error|
        @errors[id] = error.to_s
      end
      @errors.to_json


if I just use @obj.errors.to_json it gives me an array instead of a
hash (so I just have the errors strings without the key/field that it
pertains to).

Any suggestions?

-- 
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