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.2.3 lib/neo4j/shared/serialized_properties.rb
neo4j-9.2.2 lib/neo4j/shared/serialized_properties.rb
neo4j-9.2.1 lib/neo4j/shared/serialized_properties.rb
neo4j-9.2.0 lib/neo4j/shared/serialized_properties.rb
neo4j-9.1.8 lib/neo4j/shared/serialized_properties.rb
neo4j-9.1.7 lib/neo4j/shared/serialized_properties.rb
neo4j-9.1.6 lib/neo4j/shared/serialized_properties.rb
neo4j-9.1.5 lib/neo4j/shared/serialized_properties.rb
neo4j-9.1.4 lib/neo4j/shared/serialized_properties.rb
neo4j-9.1.3 lib/neo4j/shared/serialized_properties.rb
neo4j-9.1.2 lib/neo4j/shared/serialized_properties.rb
neo4j-9.1.1 lib/neo4j/shared/serialized_properties.rb
neo4j-9.1.0 lib/neo4j/shared/serialized_properties.rb
neo4j-9.0.7 lib/neo4j/shared/serialized_properties.rb
neo4j-9.0.6 lib/neo4j/shared/serialized_properties.rb
neo4j-9.0.5 lib/neo4j/shared/serialized_properties.rb
neo4j-8.3.4 lib/neo4j/shared/serialized_properties.rb
neo4j-9.0.4 lib/neo4j/shared/serialized_properties.rb
neo4j-8.3.3 lib/neo4j/shared/serialized_properties.rb
neo4j-9.0.3 lib/neo4j/shared/serialized_properties.rb