Created
April 15, 2011 08:43
-
-
Save postmodern/921409 to your computer and use it in GitHub Desktop.
Quick and Dirty way to find DataMapper Validation errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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