Skip to content

Commit

Permalink
Fixed queryBuilder .all() test
Browse files Browse the repository at this point in the history
  • Loading branch information
circulon committed Sep 10, 2024
1 parent f4dda56 commit 1ca31b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/masoniteorm/query/QueryBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1975,9 +1975,11 @@ def all(self, selects=[], query=False):
Returns:
dictionary -- Returns a dictionary of results.
"""

self.select(*selects)

if query:
return self.to_sql()
return self

result = self.new_connection().query(self.to_qmark(), self._bindings) or []

Expand Down
2 changes: 1 addition & 1 deletion tests/sqlite/models/test_sqlite_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_model_can_use_selects(self):

def test_model_can_use_selects_from_methods(self):
self.assertEqual(
SelectPass.all(["username"], query=True),
SelectPass.all(["username"], query=True).to_sql(),
'SELECT "select_passes"."username" FROM "select_passes"',
)

Expand Down

0 comments on commit 1ca31b1

Please sign in to comment.