aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorArthur Neves <arthurnn@gmail.com>2014-07-29 10:09:06 -0400
committerArthur Neves <arthurnn@gmail.com>2014-07-29 10:38:11 -0400
commitdd9829a9ea460ddcfc8d954f2b95161b52fff6e7 (patch)
tree77ff78d1374cc1e98613ebacaddb386840868f6e /activerecord
parentaade0a0412c3b8dfada4628487f6fb4c615f0060 (diff)
downloadrails-dd9829a9ea460ddcfc8d954f2b95161b52fff6e7.tar.gz
rails-dd9829a9ea460ddcfc8d954f2b95161b52fff6e7.tar.bz2
rails-dd9829a9ea460ddcfc8d954f2b95161b52fff6e7.zip
Remove @state.parent assignment on commit
This piece of code was introduced on 67d8bb963d5d51fc644d6b1ca20164efb4cee6d7 , which was calling `committed?` in the `transaction_state` before calling the `committed!` method. However on 7386ffc781fca07a0c656db49fdb54678caef809, 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.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/transaction.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb b/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
index 3a266512a9..33cc22425d 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
@@ -72,7 +72,7 @@ module ActiveRecord
end
class TransactionState
- attr_accessor :parent
+ attr_reader :parent
VALID_STATES = Set.new([:committed, :rolledback, nil])
@@ -245,7 +245,6 @@ module ActiveRecord
def perform_commit
@state.set_state(:committed)
- @state.parent = parent.state
connection.release_savepoint(@savepoint_name)
end
end