Created
April 2, 2014 20:44
-
-
Save manlycode/9942749 to your computer and use it in GitHub Desktop.
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
[ | |
BankAccount, | |
Cart, | |
CartItem, | |
Category, | |
Delivery, | |
DeliverySchedule, | |
Location, | |
Lot, | |
ManagedMarket, | |
Market, | |
MarketAddress, | |
MarketOrganization, | |
Order, | |
OrderItem, | |
OrderItemLot, | |
Organization, | |
Price, | |
Product, | |
Sequence, | |
Unit, | |
User, | |
UserOrganization | |
].each do |model| | |
model.all.select do |instance| | |
begin | |
!instance.valid? | |
rescue Exception => e | |
puts "-----------------------------" | |
puts "Error validating #{model.to_s}: #{instance.id}" | |
puts ".........." | |
puts e.message | |
puts "-----------------------------" | |
end | |
end.each do|instance| | |
puts "-----------------------------" | |
puts "Invalid instance #{model.to_s}: #{instance.id}" | |
puts ".........." | |
puts instance.errors.inspect | |
puts "-----------------------------" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment