Skip to content
Browse files

Include fixture name and errors when fixtures can't be saved.

  • Loading branch information...
1 parent 6d775bc commit c1f80623b9e3e7f56905a6b6d5b1de9976ecceec @jbarnette committed Sep 14, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/modelizer.rb
View
6 lib/modelizer.rb
@@ -62,7 +62,11 @@ def self.included klass
end
ActiveRecord::Base.transaction do
- instances.each { |_, obj| obj.save! }
+ instances.each do |name, obj|
+ unless obj.save
+ raise "'#{name}' fixture can't be saved: #{obj.errors.full_messages}"
+ end
+ end
end
end

0 comments on commit c1f8062

Please sign in to comment.
Something went wrong with that request. Please try again.