lib/jsonapi/paginator.rb in jsonapi-resources-0.10.6 vs lib/jsonapi/paginator.rb in jsonapi-resources-0.10.7
- old
+ new
@@ -11,13 +11,20 @@
# :nocov:
{}
# :nocov:
end
+ def requires_record_count
+ # :nocov:
+ self.class.requires_record_count
+ # :nocov:
+ end
+
class << self
def requires_record_count
# :nocov:
+ # @deprecated
false
# :nocov:
end
def paginator_for(paginator)
@@ -34,14 +41,19 @@
def initialize(params)
parse_pagination_params(params)
verify_pagination_params
end
+ # @deprecated
def self.requires_record_count
true
end
+ def requires_record_count
+ true
+ end
+
def apply(relation, _order_options)
relation.offset(@offset).limit(@limit)
end
def links_page_params(options = {})
@@ -125,10 +137,15 @@
def initialize(params)
parse_pagination_params(params)
verify_pagination_params
end
+ # @deprecated
def self.requires_record_count
+ true
+ end
+
+ def requires_record_count
true
end
def calculate_page_count(record_count)
(record_count / @size.to_f).ceil