aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorBrian Durand <brian@embellishedvisions.com>2010-04-29 15:13:09 -0500
committerJeremy Kemper <jeremy@bitsweat.net>2010-04-29 18:26:19 -0700
commitd2a49e4b1f30c5997e169110eed94a55aee53f56 (patch)
treeed33d21ac2054a86753baba15d840c11be9b7eee /activerecord/test
parentc54c84b7b4d933013ffc7a3ca449117bd7663433 (diff)
downloadrails-d2a49e4b1f30c5997e169110eed94a55aee53f56.tar.gz
rails-d2a49e4b1f30c5997e169110eed94a55aee53f56.tar.bz2
rails-d2a49e4b1f30c5997e169110eed94a55aee53f56.zip
Update after_commit and after_rollback docs and tests to use new style API with an :on options instead of on_* suffix.
[#2991] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/transaction_callbacks_test.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/test/cases/transaction_callbacks_test.rb b/activerecord/test/cases/transaction_callbacks_test.rb
index c2c5fd3b05..a07da093f1 100644
--- a/activerecord/test/cases/transaction_callbacks_test.rb
+++ b/activerecord/test/cases/transaction_callbacks_test.rb
@@ -10,13 +10,13 @@ class TransactionCallbacksTest < ActiveRecord::TestCase
set_table_name :topics
after_commit{|record| record.send(:do_after_commit, nil)}
- after_commit_on_create{|record| record.send(:do_after_commit, :create)}
- after_commit_on_update{|record| record.send(:do_after_commit, :update)}
- after_commit_on_destroy{|record| record.send(:do_after_commit, :destroy)}
+ after_commit(:on => :create){|record| record.send(:do_after_commit, :create)}
+ after_commit(:on => :update){|record| record.send(:do_after_commit, :update)}
+ after_commit(:on => :destroy){|record| record.send(:do_after_commit, :destroy)}
after_rollback{|record| record.send(:do_after_rollback, nil)}
- after_rollback_on_create{|record| record.send(:do_after_rollback, :create)}
- after_rollback_on_update{|record| record.send(:do_after_rollback, :update)}
- after_rollback_on_destroy{|record| record.send(:do_after_rollback, :destroy)}
+ after_rollback(:on => :create){|record| record.send(:do_after_rollback, :create)}
+ after_rollback(:on => :update){|record| record.send(:do_after_rollback, :update)}
+ after_rollback(:on => :destroy){|record| record.send(:do_after_rollback, :destroy)}
def history
@history ||= []