lib/neo4j/shared/property.rb in neo4j-9.0.0 vs lib/neo4j/shared/property.rb in neo4j-9.0.1
- old
+ new
@@ -161,15 +161,22 @@
attributes[prop_name] = attr_def
end
end
def build_property(name, options)
- DeclaredProperty.new(name, options).tap do |prop|
+ decl_prop = DeclaredProperty.new(name, options).tap do |prop|
prop.register
declared_properties.register(prop)
yield name
constraint_or_index(name, options)
end
+
+ # If this class has already been inherited, make sure subclasses inherit property
+ subclasses.each do |klass|
+ klass.inherit_property name, decl_prop.clone, declared_properties[name].options
+ end
+
+ decl_prop
end
def undef_property(name)
undef_constraint_or_index(name)
declared_properties.unregister(name)