lib/active_graph/relationship/query.rb in activegraph-12.0.0.beta.2 vs lib/active_graph/relationship/query.rb in activegraph-12.0.0.beta.3
- old
+ new
@@ -13,10 +13,10 @@
end
# Loads the relationship using its neo_id.
def find_by_id(key)
query = ActiveGraph::Base.new_query
- result = query.match('()-[r]-()').where("r.#{id_property_name}" => key).limit(1).return(:r).first
+ result = query.match("()-[r:`#{mapped_element_name}`]-()").where("r.#{id_property_name}" => key).limit(1).return(:r).first
result&.send(:[], :r)
end
# Performs a very basic match on the relationship.
# This is not executed lazily, it will immediately return matching objects.