From 87f200a575fade4c869f5966592cfac5b79cacce Mon Sep 17 00:00:00 2001 From: Lee Richmond Date: Fri, 25 Jun 2021 11:55:10 -0400 Subject: [PATCH] Fix paginate arity check This was for backwards-compatibility with custom adapters not supporting offset, but our adapters do so we never ran into the issue. --- lib/graphiti/scoping/paginate.rb | 8 ++++---- lib/graphiti/version.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/graphiti/scoping/paginate.rb b/lib/graphiti/scoping/paginate.rb index b1c1f9aa..674a23a2 100644 --- a/lib/graphiti/scoping/paginate.rb +++ b/lib/graphiti/scoping/paginate.rb @@ -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 diff --git a/lib/graphiti/version.rb b/lib/graphiti/version.rb index 5ca2feb1..e955cacd 100644 --- a/lib/graphiti/version.rb +++ b/lib/graphiti/version.rb @@ -1,3 +1,3 @@ module Graphiti - VERSION = "1.2.43" + VERSION = "1.2.44" end