aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/transactions.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-01-17 16:42:34 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-01-17 16:42:34 -0800
commit9d549986dd67df15ae45bb679ef1d9b40b4a1252 (patch)
tree755f30bd52ee94728ceb5d08a2cb57dd7c4b37fc /activerecord/lib/active_record/transactions.rb
parentd780d1f508c880c59d6d932bd052cb0b1c1c76b0 (diff)
downloadrails-9d549986dd67df15ae45bb679ef1d9b40b4a1252.tar.gz
rails-9d549986dd67df15ae45bb679ef1d9b40b4a1252.tar.bz2
rails-9d549986dd67df15ae45bb679ef1d9b40b4a1252.zip
remove useless conditional
Diffstat (limited to 'activerecord/lib/active_record/transactions.rb')
-rw-r--r--activerecord/lib/active_record/transactions.rb18
1 files changed, 8 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb
index 868f761a33..48d2f7c9a9 100644
--- a/activerecord/lib/active_record/transactions.rb
+++ b/activerecord/lib/active_record/transactions.rb
@@ -325,16 +325,14 @@ module ActiveRecord
@_start_transaction_state[:level] = (@_start_transaction_state[:level] || 0) - 1
if @_start_transaction_state[:level] < 1
restore_state = remove_instance_variable(:@_start_transaction_state)
- if restore_state
- @attributes = @attributes.dup if @attributes.frozen?
- @new_record = restore_state[:new_record]
- @destroyed = restore_state[:destroyed]
- if restore_state.has_key?(:id)
- self.id = restore_state[:id]
- else
- @attributes.delete(self.class.primary_key)
- @attributes_cache.delete(self.class.primary_key)
- end
+ @attributes = @attributes.dup if @attributes.frozen?
+ @new_record = restore_state[:new_record]
+ @destroyed = restore_state[:destroyed]
+ if restore_state.has_key?(:id)
+ self.id = restore_state[:id]
+ else
+ @attributes.delete(self.class.primary_key)
+ @attributes_cache.delete(self.class.primary_key)
end
end
end