Sha256: 0e4c09d4e061247bf93a245aff2ed01f82d3d08b7a80b26cde820d07f276b029

Contents?: true

Size: 934 Bytes

Versions: 203

Compression:

Stored size: 934 Bytes

Contents

module Neo4j::Shared
  # This module adds the `serialize` class method. It lets you store hashes and arrays in Neo4j properties.
  # Be aware that you won't be able to search within serialized properties and stuff use indexes. If you do a regex search for portion of a string
  # property, the search happens in Cypher and you may take a performance hit.
  #
  # See type_converters.rb for the serialization process.
  module SerializedProperties
    extend ActiveSupport::Concern

    def serialized_properties
      self.class.serialized_properties
    end

    def serializable_hash(*args)
      super.merge(id: id)
    end


    module ClassMethods
      def inherited(other)
        inherit_serialized_properties(other) if self.respond_to?(:serialized_properties)
        super
      end

      def inherit_serialized_properties(other)
        other.serialized_properties = self.serialized_properties
      end
    end
  end
end

Version data entries

203 entries across 203 versions & 3 rubygems

Version Path
neo4j-9.6.2 lib/neo4j/shared/serialized_properties.rb
activegraph-10.0.0.pre.alpha.11 lib/neo4j/shared/serialized_properties.rb
activegraph-10.0.0.pre.alpha.10 lib/neo4j/shared/serialized_properties.rb
activegraph-10.0.0.pre.alpha.9 lib/neo4j/shared/serialized_properties.rb
activegraph-10.0.0.pre.alpha.8 lib/neo4j/shared/serialized_properties.rb
activegraph-10.0.0.pre.alpha.7 lib/neo4j/shared/serialized_properties.rb
activegraph-10.0.0.pre.alpha.6 lib/neo4j/shared/serialized_properties.rb
neo4j-10.0.0.pre.alpha.5 lib/neo4j/shared/serialized_properties.rb
neo4j-10.0.0.pre.alpha.4 lib/neo4j/shared/serialized_properties.rb
neo4j-10.0.0.pre.alpha.3 lib/neo4j/shared/serialized_properties.rb
neo4j-10.0.0.pre.alpha.2 lib/neo4j/shared/serialized_properties.rb
neo4j-10.0.0.pre.alpha.1 lib/neo4j/shared/serialized_properties.rb
neo4j-9.6.1 lib/neo4j/shared/serialized_properties.rb
neo4j-9.6.0 lib/neo4j/shared/serialized_properties.rb
neo4j-9.5.3 lib/neo4j/shared/serialized_properties.rb
neo4j-9.5.2 lib/neo4j/shared/serialized_properties.rb
neo4j-9.5.0 lib/neo4j/shared/serialized_properties.rb
neo4j-9.4.0 lib/neo4j/shared/serialized_properties.rb
neo4j-9.3.0 lib/neo4j/shared/serialized_properties.rb
neo4j-9.2.4 lib/neo4j/shared/serialized_properties.rb