lib/neo4j/shared/property.rb in neo4j-3.0.0.rc.2 vs lib/neo4j/shared/property.rb in neo4j-3.0.0.rc.3

- old
+ new

@@ -13,16 +13,19 @@ class MultiparameterAssignmentError < StandardError; end class IllegalPropertyError < StandardError; end ILLEGAL_PROPS = %w[from_node to_node start_node end_node] + attr_reader :_persisted_obj + def initialize(attributes={}, options={}) attributes = process_attributes(attributes) - relationship_props = self.class.extract_association_attributes!(attributes) + @relationship_props = self.class.extract_association_attributes!(attributes) writer_method_props = extract_writer_methods!(attributes) validate_attributes!(attributes) send_props(writer_method_props) unless writer_method_props.nil? - send_props(relationship_props) unless relationship_props.nil? + + @_persisted_obj = nil super(attributes, options) end # Returning nil when we get ActiveAttr::UnknownAttributeError from ActiveAttr