Skip to content

Commit

Permalink
Sustain unset @reflects_state ivar
Browse files Browse the repository at this point in the history
  • Loading branch information
be9 committed Mar 11, 2015
1 parent 3cc9e21 commit 2c02a10
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/test_after_commit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ def test_commit_records
ActiveRecord::Base.class_eval do
alias_method :sync_with_transaction_state_with_state, :sync_with_transaction_state
def sync_with_transaction_state
@reflects_state[0] = true
if @reflects_state
@reflects_state[0] = true
else
@reflects_state = [true]
end

sync_with_transaction_state_with_state
end
end
Expand Down

0 comments on commit 2c02a10

Please sign in to comment.