lib/sniff/fixture.rb in sniff-1.1.0 vs lib/sniff/fixture.rb in sniff-1.1.1
- old
+ new
@@ -9,10 +9,10 @@
Dir.glob(File.join(fixtures_path, '**/*.csv')) do |fixture_file|
model_name = File.basename(fixture_file, '.csv').singularize.camelize
next unless Object.const_defined?(model_name)
model = model_name.constantize
- model.delete_all
+ model.create_table!
CSV.foreach(fixture_file, :headers => true) do |row|
ActiveRecord::Base.connection.insert_fixture(row, model.table_name) rescue ActiveRecord::RecordNotUnique
end
end
end