lib/neo4j/shared/property.rb in neo4j-6.0.9 vs lib/neo4j/shared/property.rb in neo4j-6.1.0
- old
+ new
@@ -25,11 +25,11 @@
# TODO: Remove the commented :super entirely once this code is part of a release.
# It calls an init method in active_attr that has a very negative impact on performance.
def initialize(attributes = nil)
attributes = process_attributes(attributes)
- @relationship_props = {} # self.class.extract_association_attributes!(attributes)
+ @relationship_props = self.class.extract_association_attributes!(attributes)
modded_attributes = inject_defaults!(attributes)
validate_attributes!(modded_attributes)
writer_method_props = extract_writer_methods!(modded_attributes)
send_props(writer_method_props)
@_persisted_obj = nil
@@ -129,9 +129,16 @@
module ClassMethods
extend Forwardable
def_delegators :declared_properties, :serialized_properties, :serialized_properties=, :serialize, :declared_property_defaults
+
+ def inherited(other)
+ self.declared_properties.registered_properties.each_pair do |prop_key, prop_def|
+ other.property(prop_key, prop_def.options)
+ end
+ super
+ end
# Defines a property on the class
#
# See active_attr gem for allowed options, e.g which type
# Notice, in Neo4j you don't have to declare properties before using them, see the neo4j-core api.