diff options
Diffstat (limited to 'activerecord/lib/active_record/fixtures.rb')
-rwxr-xr-x | activerecord/lib/active_record/fixtures.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 66cf3f237b..51202b3f92 100755 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -505,7 +505,8 @@ module Test #:nodoc: end def setup_with_fixtures - return if !defined?(ActiveRecord::Base) || ActiveRecord::Base.configurations.blank? + return unless defined?(ActiveRecord::Base) + if pre_loaded_fixtures && !use_transactional_fixtures raise RuntimeError, 'pre_loaded_fixtures requires use_transactional_fixtures' end @@ -536,7 +537,8 @@ module Test #:nodoc: alias_method :setup, :setup_with_fixtures def teardown_with_fixtures - return if !defined?(ActiveRecord::Base) || ActiveRecord::Base.configurations.blank? + return unless defined?(ActiveRecord::Base) + # Rollback changes. if use_transactional_fixtures? ActiveRecord::Base.connection.rollback_db_transaction |