Skip to content
Browse files

Remove @state.parent assignment on commit

This piece of code was introduced on
67d8bb9 , which was calling
`committed?` in the `transaction_state` before calling the `committed!`
method. However on 7386ffc, the
`committed?` check was removed and replaced by a `finalized?`, which
only checks if the state is not nil. Thus we can remove that line.
  • Loading branch information...
1 parent aade0a0 commit dd9829a9ea460ddcfc8d954f2b95161b52fff6e7 @arthurnn arthurnn committed Jul 29, 2014
Showing with 1 addition and 2 deletions.
  1. +1 −2 activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
View
3 activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
@@ -72,7 +72,7 @@ def savepoint_name
end
class TransactionState
- attr_accessor :parent
+ attr_reader :parent
VALID_STATES = Set.new([:committed, :rolledback, nil])
@@ -245,7 +245,6 @@ def perform_rollback
def perform_commit
@state.set_state(:committed)
- @state.parent = parent.state
connection.release_savepoint(@savepoint_name)
end
end

0 comments on commit dd9829a

Please sign in to comment.
Something went wrong with that request. Please try again.