aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/transaction_callbacks_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/transaction_callbacks_test.rb')
-rw-r--r--activerecord/test/cases/transaction_callbacks_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/transaction_callbacks_test.rb b/activerecord/test/cases/transaction_callbacks_test.rb
index 9246157a13..6e6a9afeff 100644
--- a/activerecord/test/cases/transaction_callbacks_test.rb
+++ b/activerecord/test/cases/transaction_callbacks_test.rb
@@ -297,7 +297,13 @@ class SaveFromAfterCommitBlockTest < ActiveRecord::TestCase
class TopicWithSaveInCallback < ActiveRecord::Base
self.table_name = :topics
after_commit :cache_topic, :on => :create
+ after_commit :call_update, :on => :update
attr_accessor :cached
+ attr_accessor :record_updated
+
+ def call_update
+ self.record_updated = true
+ end
def cache_topic
unless cached
@@ -313,5 +319,6 @@ class SaveFromAfterCommitBlockTest < ActiveRecord::TestCase
topic = TopicWithSaveInCallback.new()
topic.save
assert_equal true, topic.cached
+ assert_equal true, topic.record_updated
end
end