Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove uneeded local var definition.

  • Loading branch information...
commit 9c161599ac1e37eedd56bece4d975dde8cdaa151 1 parent a9e963d
Emilio Tagua miloops authored tenderlove committed
Showing with 1 addition and 2 deletions.
  1. +1 −2  activerecord/lib/active_record/nested_attributes.rb
3  activerecord/lib/active_record/nested_attributes.rb
View
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.