Permalink
Browse files

1 over 0 on Integer if value is nil

  • Loading branch information...
1 parent 2df0cc0 commit cd1c67c23bca3f64b37a16d25947e2c23f66a28c @nitsujw committed Sep 10, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/will_paginate/page_number.rb
@@ -13,7 +13,7 @@ class PageNumber < DelegateClass(Integer)
extend Forwardable
def initialize(value, name)
- value = Integer(value.nil? ? 0 : value)
+ value = Integer(value.nil? ? 1 : value)
if 'offset' == name ? (value < 0 or value > BIGINT) : value < 1
raise RangeError, "invalid #{name}: #{value.inspect}"
end

0 comments on commit cd1c67c

Please sign in to comment.