Sha256: 0000d72ffa30a03f2c40d5edca85e00326deee4d5dce484d0208cc8cc37c4b08

Contents?: true

Size: 940 Bytes

Versions: 42

Compression:

Stored size: 940 Bytes

Contents

module ActiveGraph::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

42 entries across 42 versions & 1 rubygems

Version Path
activegraph-10.1.1 lib/active_graph/shared/serialized_properties.rb
activegraph-11.0.1-java lib/active_graph/shared/serialized_properties.rb
activegraph-11.0.0-java lib/active_graph/shared/serialized_properties.rb
activegraph-10.1.0 lib/active_graph/shared/serialized_properties.rb
activegraph-11.0.0.beta.4-java lib/active_graph/shared/serialized_properties.rb
activegraph-10.0.2 lib/active_graph/shared/serialized_properties.rb
activegraph-11.0.0.beta.3-java lib/active_graph/shared/serialized_properties.rb
activegraph-11.0.0.beta.2-java lib/active_graph/shared/serialized_properties.rb
activegraph-11.0.0.beta.1-java lib/active_graph/shared/serialized_properties.rb
activegraph-10.0.1 lib/active_graph/shared/serialized_properties.rb
activegraph-10.0.0 lib/active_graph/shared/serialized_properties.rb
activegraph-10.0.0.pre.beta.11 lib/active_graph/shared/serialized_properties.rb
activegraph-10.0.0.pre.beta.10 lib/active_graph/shared/serialized_properties.rb
activegraph-10.0.0.pre.beta.9 lib/active_graph/shared/serialized_properties.rb
activegraph-10.0.0.pre.beta.8 lib/active_graph/shared/serialized_properties.rb
activegraph-10.0.0.pre.beta.7 lib/active_graph/shared/serialized_properties.rb
activegraph-10.0.0.pre.beta.6 lib/active_graph/shared/serialized_properties.rb
activegraph-10.0.0.pre.beta.5 lib/active_graph/shared/serialized_properties.rb
activegraph-10.0.0.pre.beta.4 lib/active_graph/shared/serialized_properties.rb
activegraph-10.0.0.pre.beta.3 lib/active_graph/shared/serialized_properties.rb