@@ -464,9 +464,9 @@ def self.save_records(models, associations, acting_user, validate, save)
464464 dont_save_list . delete ( parent )
465465
466466
467- if reactive_records [ association [ :child_id ] ] &.new_record?
468- dont_save_list << reactive_records [ association [ :child_id ] ]
469- end
467+ # if reactive_records[association[:child_id]]&.new_record?
468+ # dont_save_list << reactive_records[association[:child_id]]
469+ # end
470470 #if false and parent.new?
471471 #parent.send("#{association[:attribute]}") << reactive_records[association[:child_id]]
472472 # puts "updated"
@@ -478,10 +478,10 @@ def self.save_records(models, associations, acting_user, validate, save)
478478 parent . send ( "#{ association [ :attribute ] } =" , reactive_records [ association [ :child_id ] ] )
479479 dont_save_list . delete ( parent )
480480
481- if parent . class . reflect_on_association ( association [ :attribute ] . to_sym ) . macro == :has_one &&
482- reactive_records [ association [ :child_id ] ] &.new_record?
483- dont_save_list << reactive_records [ association [ :child_id ] ]
484- end
481+ # if parent.class.reflect_on_association(association[:attribute].to_sym).macro == :has_one &&
482+ # reactive_records[association[:child_id]]&.new_record?
483+ # dont_save_list << reactive_records[association[:child_id]]
484+ # end
485485 end
486486 end if associations
487487 # get rid of any records that don't require further processing, as a side effect
@@ -493,7 +493,8 @@ def self.save_records(models, associations, acting_user, validate, save)
493493 next true if dont_save_list . include? ( record ) # skip if the record is on the don't save list
494494 next true if record . changed . include? ( record . class . primary_key ) # happens on an aggregate
495495 #next true if record.persisted? # record may be have been saved as result of has_one assignment
496- next record . persisted? if record . id && !record . changed? # throw out any existing records with no changes
496+ # next false if record.id && !record.changed? # throw out any existing records with no changes
497+ next record . persisted? if record . id && !record . changed?
497498 # if we get to here save the record and return true to keep it
498499 op = new_models . include? ( record ) ? :create_permitted? : :update_permitted?
499500 record . check_permission_with_acting_user ( acting_user , op ) . save ( validate : false ) || true
0 commit comments