Skip to content

Commit c10c808

Browse files
author
Lee Richmond
committed
Fix Rails 5.1 compat
1 parent 634b1ef commit c10c808

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/jsonapi_compliable/adapters/active_record.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ def paginate(scope, current_page, per_page)
2121

2222
# (see Adapters::Abstract#count)
2323
def count(scope, attr)
24-
column = attr == :total ? :all : attr
25-
scope.distinct.count(column)
24+
if attr.to_sym == :total
25+
scope.distinct.count
26+
else
27+
scope.distinct.count(attr)
28+
end
2629
end
2730

2831
# (see Adapters::Abstract#average)

0 commit comments

Comments
 (0)