lib/pagy/countless.rb in pagy-5.1.3 vs lib/pagy/countless.rb in pagy-5.2.0
- old
+ new
@@ -14,10 +14,10 @@
@offset = (@items * (@page - 1)) + @outset
end
# Finalize the instance variables based on the fetched size
def finalize(fetched_size)
- raise OverflowError.new(self, :page, "to be < #{@page}") if fetched_size.zero? && @page > 1
+ raise OverflowError.new(self, :page, "to be < #{@page}", @page) if fetched_size.zero? && @page > 1
@pages = @last = (fetched_size > @items ? @page + 1 : @page)
@in = [fetched_size, @items].min
@from = @in.zero? ? 0 : @offset - @outset + 1
@to = @offset - @outset + @in