lib/neo4j/active_rel/rel_wrapper.rb in neo4j-8.1.5 vs lib/neo4j/active_rel/rel_wrapper.rb in neo4j-8.2.1
- old
+ new
@@ -9,11 +9,12 @@
module RelWrapping
class << self
def wrapper(rel)
rel.props.symbolize_keys!
begin
- most_concrete_class = class_from_type(rel.rel_type)
- most_concrete_class.constantize.new
+ most_concrete_class = class_from_type(rel.rel_type).constantize
+ return rel unless most_concrete_class < Neo4j::ActiveRel
+ most_concrete_class.new
rescue NameError => e
raise e unless e.message =~ /(uninitialized|wrong) constant/
return rel
end.tap do |wrapped_rel|