Reputation: 11336
There's an easy why that I don't remember to retrieve all invalid objects saved in the database from rails console.
Any idea how?
Upvotes: 4
Views: 2262
Reputation: 9014
say your model is called Widget, then:
Widget.all.select(&:invalid?)
That's likely to be very slow if you have a lot of data, but you have to retrieve the records from the database if you want to check their validity.
Upvotes: 12