Skip to content

Commit

Permalink
Fix paginate arity check
Browse files Browse the repository at this point in the history
This was for backwards-compatibility with custom adapters not supporting
offset, but our adapters do so we never ran into the issue.
  • Loading branch information
richmolj committed Jun 25, 2021
1 parent 6807f54 commit 87f200a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/graphiti/scoping/paginate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ def custom_scope

# Apply default pagination proc via the Resource adapter
def apply_standard_scope
arity = resource.adapter.method(:paginate)
meth = resource.adapter.method(:paginate)

if arity == 4 # backwards-compat
resource.adapter.paginate(@scope, number, size)
else
if meth.arity == 4 # backwards-compat
resource.adapter.paginate(@scope, number, size, offset)
else
resource.adapter.paginate(@scope, number, size)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/graphiti/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Graphiti
VERSION = "1.2.43"
VERSION = "1.2.44"
end

0 comments on commit 87f200a

Please sign in to comment.