lib/neo4j/active_node/property.rb in neo4j-4.0.0 vs lib/neo4j/active_node/property.rb in neo4j-4.1.0
- old
+ new
@@ -1,22 +1,21 @@
module Neo4j::ActiveNode
module Property
extend ActiveSupport::Concern
include Neo4j::Shared::Property
- def initialize(attributes={}, options={})
+ def initialize(attributes = {}, options = {})
super(attributes, options)
- send_props(@relationship_props) if persisted? and not @relationship_props.nil?
+ send_props(@relationship_props) if persisted? && !@relationship_props.nil?
end
module ClassMethods
-
# Extracts keys from attributes hash which are relationships of the model
# TODO: Validate separately that relationships are getting the right values? Perhaps also store the values and persist relationships on save?
def extract_association_attributes!(attributes)
attributes.keys.each_with_object({}) do |key, association_props|
- association_props[key] = attributes.delete(key) if self.has_association?(key)
+ association_props[key] = attributes.delete(key) if self.association?(key)
end
end
end
end
end