Skip to content

Commit a258d8b

Browse files
committed
obtain class from #klass instead
1 parent 0b1a31d commit a258d8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/api-pagination.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ def default_per_page_for_will_paginate(collection)
8181
end
8282

8383
def detect_model(collection)
84-
if collection.respond_to?(:table_name)
85-
collection.table_name.classify.constantize
84+
if collection.respond_to?(:klass)
85+
collection.klass
8686
else
8787
collection.first.class
8888
end

0 commit comments

Comments
 (0)