Project

General

Profile

« Previous | Next » 

Revision 8fd3c579

Added by Dominic Cleal over 8 years ago

fixes #11807 - update existing lookup value when changed from nested host form

View differences:

app/models/concerns/host_common.rb
lookup_values_attributes.each_value do |attribute|
attr = attribute.dup
if id = attr.delete(:id)
lookup_value = self.lookup_values.to_a.select{|i| i.id == id}.first
lookup_value = self.lookup_values.to_a.find {|i| i.id.to_i == id.to_i }
if lookup_value
mark_for_destruction = ActiveRecord::ConnectionAdapters::Column.value_to_boolean attr.delete(:_destroy)
lookup_value.attributes = attr

Also available in: Unified diff