aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2010-11-20 07:46:56 +0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-24 01:36:59 +0800
commit9c161599ac1e37eedd56bece4d975dde8cdaa151 (patch)
tree0df8d07bf3aa0e4ab1199de891356f44b1214b86 /activerecord/lib
parenta9e963d51d262a0693f0b83508c40a250421f826 (diff)
downloadrails-9c161599ac1e37eedd56bece4d975dde8cdaa151.tar.gz
rails-9c161599ac1e37eedd56bece4d975dde8cdaa151.tar.bz2
rails-9c161599ac1e37eedd56bece4d975dde8cdaa151.zip
Remove uneeded local var definition.
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/nested_attributes.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb
index f1d3eaed38..a2101a02eb 100644
--- a/activerecord/lib/active_record/nested_attributes.rb
+++ b/activerecord/lib/active_record/nested_attributes.rb
@@ -322,9 +322,8 @@ module ActiveRecord
def assign_nested_attributes_for_one_to_one_association(association_name, attributes)
options = self.nested_attributes_options[association_name]
attributes = attributes.with_indifferent_access
- check_existing_record = (options[:update_only] || !attributes['id'].blank?)
- if check_existing_record && (record = send(association_name)) &&
+ if (options[:update_only] || !attributes['id'].blank?) && (record = send(association_name)) &&
(options[:update_only] || record.id.to_s == attributes['id'].to_s)
assign_to_or_mark_for_destruction(record, attributes, options[:allow_destroy]) unless call_reject_if(association_name, attributes)