Sha256: 18b979f1dea365130e2d364a9fba1d6d6f05610a0da77f738d48be51b766ebac

Contents?: true

Size: 797 Bytes

Versions: 12

Compression:

Stored size: 797 Bytes

Contents

module Neo4j::ActiveNode
  module Property
    extend ActiveSupport::Concern
    include Neo4j::Shared::Property

    def initialize(attributes={}, options={})
      super(attributes, options)

      send_props(@relationship_props) if persisted? and not @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)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
neo4j-4.0.0 lib/neo4j/active_node/property.rb
neo4j-4.0.0.rc.4 lib/neo4j/active_node/property.rb
neo4j-4.0.0.rc.3 lib/neo4j/active_node/property.rb
neo4j-4.0.0.rc.1 lib/neo4j/active_node/property.rb
neo4j-3.0.4 lib/neo4j/active_node/property.rb
neo4j-3.0.3 lib/neo4j/active_node/property.rb
neo4j-3.0.2 lib/neo4j/active_node/property.rb
neo4j-3.0.1 lib/neo4j/active_node/property.rb
neo4j-3.0.0 lib/neo4j/active_node/property.rb
neo4j-3.0.0.rc.5 lib/neo4j/active_node/property.rb
neo4j-3.0.0.rc.4 lib/neo4j/active_node/property.rb
neo4j-3.0.0.rc.3 lib/neo4j/active_node/property.rb