Permalink
Browse files

Remove uneeded local var definition.

  • Loading branch information...
1 parent a9e963d commit 9c161599ac1e37eedd56bece4d975dde8cdaa151 @miloops miloops committed with tenderlove Nov 19, 2010
Showing with 1 addition and 2 deletions.
  1. +1 −2 activerecord/lib/active_record/nested_attributes.rb
@@ -322,9 +322,8 @@ def _destroy
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)

0 comments on commit 9c16159

Please sign in to comment.