lib/temping.rb in temping-3.6.1 vs lib/temping.rb in temping-3.7.0
- old
+ new
@@ -10,19 +10,19 @@
klass = factory.klass
@model_klasses << klass
klass
end
- def teardown
+ def teardown(clear_dependencies: false)
if @model_klasses.any?
@model_klasses.each do |klass|
if Object.const_defined?(klass.name)
klass.connection.drop_table(klass.table_name)
Object.send(:remove_const, klass.name)
end
end
@model_klasses.clear
- ActiveSupport::Dependencies.clear
+ ActiveSupport::Dependencies.clear if clear_dependencies
end
end
def cleanup
@model_klasses.each(&:destroy_all)