diff options
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb | 2 | ||||
-rw-r--r-- | railties/test/application/rake/dbs_test.rb | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb index c8c3fcb22a..2d90f1b0cb 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb @@ -176,7 +176,7 @@ module ActiveRecord ensure begin commit_transaction unless error - rescue Exception => e + rescue Exception rollback_transaction raise end diff --git a/railties/test/application/rake/dbs_test.rb b/railties/test/application/rake/dbs_test.rb index 52c07cee9f..74a759b190 100644 --- a/railties/test/application/rake/dbs_test.rb +++ b/railties/test/application/rake/dbs_test.rb @@ -100,7 +100,7 @@ module ApplicationTests `rails generate model book title:string` `bundle exec rake db:migrate` `bundle exec rake db:fixtures:load` - assert_match /#{expected[:database]}/, + assert_match(/#{expected[:database]}/), ActiveRecord::Base.connection_config[:database] require "#{app_path}/app/models/book" assert_equal 2, Book.count @@ -129,7 +129,7 @@ module ApplicationTests assert_match(/CREATE TABLE \"books\"/, structure_dump) `bundle exec rake db:drop` `bundle exec rake db:structure:load` - assert_match /#{expected[:database]}/, + assert_match(/#{expected[:database]}/), ActiveRecord::Base.connection_config[:database] require "#{app_path}/app/models/book" #if structure is not loaded correctly, exception would be raised @@ -161,7 +161,7 @@ module ApplicationTests require "#{app_path}/app/models/book" #if structure is not loaded correctly, exception would be raised assert Book.count, 0 - assert_match /#{ActiveRecord::Base.configurations['test']['database']}/, + assert_match(/#{ActiveRecord::Base.configurations['test']['database']}/), ActiveRecord::Base.connection_config[:database] end end |