Skip to content

Instantly share code, notes, and snippets.

@postmodern
Created April 15, 2011 08:43
Show Gist options
  • Save postmodern/921409 to your computer and use it in GitHub Desktop.
Save postmodern/921409 to your computer and use it in GitHub Desktop.
Quick and Dirty way to find DataMapper Validation errors.
require 'pp'
invalids = ObjectSpace.each_object(DataMapper::Resource).select { |obj| !obj.saved? && !obj.valid? }
pp invalids.map { |obj| [obj.class, obj.errors.to_hash] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment