X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ea59d95f4aad7cafe3a0d0b4d5ef533b0662e365..09b4997e8b917af48b4c8baedc6ee77048f2030a:/lib/classic_pagination/pagination.rb diff --git a/lib/classic_pagination/pagination.rb b/lib/classic_pagination/pagination.rb index 53e730afc..c59c1a901 100644 --- a/lib/classic_pagination/pagination.rb +++ b/lib/classic_pagination/pagination.rb @@ -240,10 +240,8 @@ module ActionController # object, its +number+ attribute is used as the value; if the page does # not belong to this Paginator, an ArgumentError is raised. def current_page=(page) - if page.is_a? Page - raise ArgumentError, "Page/Paginator mismatch" unless - page.paginator == self - end + raise ArgumentError, "Page/Paginator mismatch" if page.is_a?(Page) && page.paginator != self + page = page.to_i @current_page_number = has_page_number?(page) ? page : 1 end