aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/transactions_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2010-06-08 14:40:20 -0400
committerJeremy Kemper <jeremy@bitsweat.net>2010-06-08 14:56:08 -0400
commit1b2941cba1165b0721f57524645fe378bee2a950 (patch)
tree40d88f07c8bed5a15304753277917750c5885ed9 /activerecord/test/cases/transactions_test.rb
parent32d4330b8185caa05af6ae69b0769b34b5e159eb (diff)
downloadrails-1b2941cba1165b0721f57524645fe378bee2a950.tar.gz
rails-1b2941cba1165b0721f57524645fe378bee2a950.tar.bz2
rails-1b2941cba1165b0721f57524645fe378bee2a950.zip
Temporarily revert "Update after_commit and after_rollback docs and tests to use new style API with an :on options instead of on_* suffix." and "Add after_commit and after_rollback callbacks to ActiveRecord that are called after transactions either commit or rollback on all records saved or destroyed in the transaction."
This reverts commits d2a49e4b1f30c5997e169110eed94a55aee53f56 and da840d13da865331297d5287391231b1ed39721b. [#2991] Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/transactions.rb activerecord/test/cases/transaction_callbacks_test.rb
Diffstat (limited to 'activerecord/test/cases/transactions_test.rb')
-rw-r--r--activerecord/test/cases/transactions_test.rb33
1 files changed, 0 insertions, 33 deletions
diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb
index 958a4e4f94..00f3b527d7 100644
--- a/activerecord/test/cases/transactions_test.rb
+++ b/activerecord/test/cases/transactions_test.rb
@@ -320,33 +320,6 @@ class TransactionTest < ActiveRecord::TestCase
end
end
- def test_restore_active_record_state_for_all_records_in_a_transaction
- topic_1 = Topic.new(:title => 'test_1')
- topic_2 = Topic.new(:title => 'test_2')
- Topic.transaction do
- assert topic_1.save
- assert topic_2.save
- @first.save
- @second.destroy
- assert_equal false, topic_1.new_record?
- assert_not_nil topic_1.id
- assert_equal false, topic_2.new_record?
- assert_not_nil topic_2.id
- assert_equal false, @first.new_record?
- assert_not_nil @first.id
- assert_equal true, @second.destroyed?
- raise ActiveRecord::Rollback
- end
-
- assert_equal true, topic_1.new_record?
- assert_nil topic_1.id
- assert_equal true, topic_2.new_record?
- assert_nil topic_2.id
- assert_equal false, @first.new_record?
- assert_not_nil @first.id
- assert_equal false, @second.destroyed?
- end
-
if current_adapter?(:PostgreSQLAdapter) && defined?(PGconn::PQTRANS_IDLE)
def test_outside_transaction_works
assert Topic.connection.outside_transaction?
@@ -409,12 +382,6 @@ class TransactionTest < ActiveRecord::TestCase
end
private
- def define_callback_method(callback_method)
- define_method(callback_method) do
- self.history << [callback_method, :method]
- end
- end
-
def add_exception_raising_after_save_callback_to_topic
Topic.class_eval <<-eoruby, __FILE__, __LINE__ + 1
remove_method(:after_save_for_transaction)