Skip to content

Instantly share code, notes, and snippets.

@lucas-clemente
Created July 7, 2012 17:20
Show Gist options
  • Save lucas-clemente/3067248 to your computer and use it in GitHub Desktop.
Save lucas-clemente/3067248 to your computer and use it in GitHub Desktop.
Validate all rows in a rails database
Dir['app/models/*.rb'].map {|f| File.basename(f, '.*').camelize.constantize }.map { |c| {c.name => c.all.select {|f| f.invalid?}.map {|f| f.errors}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment