aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-07-03 20:49:57 +0200
committerYves Senn <yves.senn@gmail.com>2013-07-03 20:49:57 +0200
commitfca29750e40e9499aa6fb6de4fa3d2d972d5a4d5 (patch)
tree7fd881dd27d3cf51f27cc8f2c5054ed763b69a10 /activerecord
parentefb6c16b40fe8f43341e4511fd811e58030a8afd (diff)
downloadrails-fca29750e40e9499aa6fb6de4fa3d2d972d5a4d5.tar.gz
rails-fca29750e40e9499aa6fb6de4fa3d2d972d5a4d5.tar.bz2
rails-fca29750e40e9499aa6fb6de4fa3d2d972d5a4d5.zip
remove deprecated `PostgreSQLAdapter#outside_transaction?` method.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG.md5
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb7
-rw-r--r--activerecord/test/cases/transactions_test.rb10
3 files changed, 5 insertions, 17 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index f76246f7a3..9cd011aef5 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,8 @@
+* Remove deprecated `PostgreSQLAdapter#outside_transaction?`
+ method. You can use `#transaction_open?` instead.
+
+ *Yves Senn*
+
* Remove deprecated `ActiveRecord::Fixtures.find_table_name` in favor of
`ActiveRecord::Fixtures.default_fixture_model_name`.
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb
index 9b5170f657..751655e61c 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb
@@ -218,13 +218,6 @@ module ActiveRecord
execute "ROLLBACK"
end
- def outside_transaction?
- message = "#outside_transaction? is deprecated. This method was only really used " \
- "internally, but you can use #transaction_open? instead."
- ActiveSupport::Deprecation.warn message
- @connection.transaction_status == PGconn::PQTRANS_IDLE
- end
-
def create_savepoint
execute("SAVEPOINT #{current_savepoint_name}")
end
diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb
index 6d66342fa5..f4814f1c42 100644
--- a/activerecord/test/cases/transactions_test.rb
+++ b/activerecord/test/cases/transactions_test.rb
@@ -410,16 +410,6 @@ class TransactionTest < ActiveRecord::TestCase
assert !@second.destroyed?, 'not destroyed'
end
- if current_adapter?(:PostgreSQLAdapter) && defined?(PGconn::PQTRANS_IDLE)
- def test_outside_transaction_works
- assert assert_deprecated { Topic.connection.outside_transaction? }
- Topic.connection.begin_db_transaction
- assert assert_deprecated { !Topic.connection.outside_transaction? }
- Topic.connection.rollback_db_transaction
- assert assert_deprecated { Topic.connection.outside_transaction? }
- end
- end
-
def test_sqlite_add_column_in_transaction
return true unless current_adapter?(:SQLite3Adapter)