From 26fcdba50aef0476cd4a1788781f8f622aaa3534 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Sun, 1 Sep 2024 18:00:58 -0400 Subject: [PATCH] fixed missing where on has many through relationship --- src/masoniteorm/relationships/HasManyThrough.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/masoniteorm/relationships/HasManyThrough.py b/src/masoniteorm/relationships/HasManyThrough.py index 52460314..86174cfb 100644 --- a/src/masoniteorm/relationships/HasManyThrough.py +++ b/src/masoniteorm/relationships/HasManyThrough.py @@ -81,7 +81,7 @@ def apply_query(self, distant_builder, intermediary_builder, owner): f"{self.intermediary_builder.get_table_name()}.{self.foreign_key}", "=", f"{distant_builder.get_table_name()}.{self.other_owner_key}", - ).get() + ).where(f"{self.intermediary_builder.get_table_name()}.{self.local_owner_key}", getattr(owner, self.other_owner_key)).get() return result