Skip to content

Commit fafdc37

Browse files
author
Olivier Bonnaure
committed
fix: arango_model : sort => order
1 parent 4e44862 commit fafdc37

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.lua/arango_model.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function ArangoModel:all(options)
5858

5959
local offset = options.per_page * (options.page - 1)
6060

61-
self.data = Adb.primary:Aql(
61+
local request = Adb.primary:Aql(
6262
[[
6363
FOR doc IN @@collection
6464
]] .. table.concat(self.filters) .. [[
@@ -71,7 +71,10 @@ function ArangoModel:all(options)
7171
["per_page"] = options.per_page,
7272
["offset"] = offset
7373
}, self.bindvars)
74-
).result
74+
)
75+
76+
self.data = request.result
77+
7578
return self
7679
end
7780

@@ -173,7 +176,7 @@ end
173176

174177
-- sorting
175178

176-
function ArangoModel:sort(sort)
179+
function ArangoModel:order(sort)
177180
self.sort = sort
178181
return self
179182
end

0 commit comments

Comments
 (0)