lib/neo4j/active_rel/persistence.rb in neo4j-3.0.2 vs lib/neo4j/active_rel/persistence.rb in neo4j-3.0.3
- old
+ new
@@ -52,10 +52,10 @@
def confirm_node_classes
[from_node, to_node].each do |node|
type = from_node == node ? :_from_class : :_to_class
next if allows_any_class?(type)
- raise ModelClassInvalidError, "Node class was #{node.class}, expected #{self.class.send(type)}" unless class_as_constant(type) == node.class
+ raise ModelClassInvalidError, "Node class was #{node.class}, expected #{self.class.send(type)}" unless class_as_constant(type) == node.class || node.class.ancestors.include?(class_as_constant(type))
end
end
def _create_rel(from_node, to_node, *args)
props = self.class.default_property_values(self)
\ No newline at end of file