File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -111,12 +111,12 @@ def after_rollback(&block)
111
111
def open?
112
112
true
113
113
end
114
- alias_method :blank? , :open?
115
114
116
115
# Returns true if no transaction is currently active.
117
116
def closed?
118
117
false
119
118
end
119
+ alias_method :blank? , :closed?
120
120
121
121
# Returns a UUID for this transaction.
122
122
def uuid
Original file line number Diff line number Diff line change @@ -19,7 +19,14 @@ def setup
19
19
@first , @second = Topic . find ( 1 , 2 ) . sort_by ( &:id )
20
20
end
21
21
22
- def test_after_all_transactions_committ
22
+ def test_blank?
23
+ assert_predicate Topic . current_transaction , :blank?
24
+ Topic . transaction do
25
+ assert_not_predicate Topic . current_transaction , :blank?
26
+ end
27
+ end
28
+
29
+ def test_after_all_transactions_commit
23
30
called = 0
24
31
ActiveRecord . after_all_transactions_commit { called += 1 }
25
32
assert_equal 1 , called
You can’t perform that action at this time.
0 commit comments