lib/neo4j/active_node/unpersisted.rb in neo4j-5.1.5 vs lib/neo4j/active_node/unpersisted.rb in neo4j-5.2.0

- old
+ new

@@ -38,13 +38,11 @@ element.is_a?(Array) ? element.each { |node| association_proc.call(node) } : association_proc.call(element) end end def save_and_associate_node(association_name, node, operator) - if node.respond_to?(:changed?) - node.save if node.changed? || !node.persisted? - fail "Unable to defer node persistence, could not save #{node.inspect}" unless node.persisted? - end + node.save if node.changed? || !node.persisted? + fail "Unable to defer node persistence, could not save #{node.inspect}" unless node.persisted? operator == :<< ? send(association_name).send(operator, node) : send(:"#{association_name}=", node) end end end end