From e4459d6b2b412439b179223958b7446b616c0ea5 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Sun, 18 Aug 2024 11:47:28 -0400 Subject: [PATCH] fixed has many though relationship --- src/masoniteorm/relationships/HasManyThrough.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/masoniteorm/relationships/HasManyThrough.py b/src/masoniteorm/relationships/HasManyThrough.py index ee7396e1..52460314 100644 --- a/src/masoniteorm/relationships/HasManyThrough.py +++ b/src/masoniteorm/relationships/HasManyThrough.py @@ -76,14 +76,14 @@ def apply_query(self, distant_builder, intermediary_builder, owner): dict -- A dictionary of data which will be hydrated. """ # select * from `countries` inner join `ports` on `ports`.`country_id` = `countries`.`country_id` where `ports`.`port_id` is null and `countries`.`deleted_at` is null and `ports`.`deleted_at` is null - distant_builder.join( + result = distant_builder.join( f"{self.intermediary_builder.get_table_name()}", f"{self.intermediary_builder.get_table_name()}.{self.foreign_key}", "=", f"{distant_builder.get_table_name()}.{self.other_owner_key}", - ) + ).get() - return self + return result def relate(self, related_model): return self.distant_builder.join(