X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/d6f8302eaeac711f8738c956f46c92de9743fed3..adb034d26e6f465d07c75a2fcfd3477c38539c4f:/lib/classic_pagination/pagination.rb diff --git a/lib/classic_pagination/pagination.rb b/lib/classic_pagination/pagination.rb index c7022e0b0..97f0530a8 100644 --- a/lib/classic_pagination/pagination.rb +++ b/lib/classic_pagination/pagination.rb @@ -278,7 +278,7 @@ module ActionController # Returns true if this paginator contains the page of index +number+. def contains_page?(number) - number >= 1 && number <= page_count + number.between?(1, page_count) end # Returns a new Page representing the page with the given index @@ -288,7 +288,7 @@ module ActionController end # Successively yields all the paginator's pages to the given block. - def each(&_block) + def each(&) page_count.times do |n| yield self[n + 1] end