module Neo4j::ActiveRel::Property::ClassMethods

Public Instance Methods

extract_association_attributes!(attributes) click to toggle source

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?

   # File lib/neo4j/active_rel/property.rb
44 def extract_association_attributes!(attributes)
45   return if attributes.blank?
46   {}.tap do |relationship_props|
47     attributes.each_key do |key|
48       relationship_props[key] = attributes.delete(key) if [:from_node, :to_node].include?(key)
49     end
50   end
51 end
id_property_name() click to toggle source
   # File lib/neo4j/active_rel/property.rb
53 def id_property_name
54   false
55 end
load_entity(id) click to toggle source
   # File lib/neo4j/active_rel/property.rb
79 def load_entity(id)
80   Neo4j::Node.load(id)
81 end
valid_class_argument?(class_argument) click to toggle source
   # File lib/neo4j/active_rel/property.rb
71 def valid_class_argument?(class_argument)
72   [String, Symbol, FalseClass].include?(class_argument.class) ||
73     (class_argument.is_a?(Array) && class_argument.all? { |c| [String, Symbol].include?(c.class) })
74 end