Skip to content

Commit

Permalink
Merge pull request #890 from MasoniteFramework/hotfix/has-many
Browse files Browse the repository at this point in the history
fixed has many
  • Loading branch information
josephmancuso authored Sep 1, 2024
2 parents 5649282 + bff9d8b commit 100c791
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/masoniteorm/query/QueryBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1955,9 +1955,9 @@ def _register_relationships_to_model(
map_related = self._map_related(related_result, related)
for model in hydrated_model:
if isinstance(related_result, Collection):
related.register_related(relation_key, model, related_result)
related.register_related(relation_key, model, map_related)
else:
model.add_relation({relation_key: related_result or None})
model.add_relation({relation_key: map_related or None})
else:
hydrated_model.add_relation({relation_key: related_result or None})
return self
Expand Down

0 comments on commit 100c791

Please sign in to comment.