From 79cde6eb0bbda73301c51065479eeb2469f0614e Mon Sep 17 00:00:00 2001 From: Heinrich Klobuczek Date: Mon, 15 Jan 2024 23:04:31 +0100 Subject: [PATCH] find by id of relationship uses relationship type now and leverages index --- lib/active_graph/relationship/query.rb | 2 +- lib/active_graph/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/active_graph/relationship/query.rb b/lib/active_graph/relationship/query.rb index 1616599cf..6b476be34 100644 --- a/lib/active_graph/relationship/query.rb +++ b/lib/active_graph/relationship/query.rb @@ -15,7 +15,7 @@ def find(id) # 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 diff --git a/lib/active_graph/version.rb b/lib/active_graph/version.rb index eed5840c7..a76f71995 100644 --- a/lib/active_graph/version.rb +++ b/lib/active_graph/version.rb @@ -1,3 +1,3 @@ module ActiveGraph - VERSION = '12.0.0.beta.2' + VERSION = '12.0.0.beta.3' end