Yuki Nishijima
03fe8ba9b0
Use default_per_page value when per(nil)
...
closes #356
2013-06-18 22:37:33 +09:00
Yuki Nishijima
d79c94626c
Revert "Merge pull request #304 from bricker88/nil_for_per"
...
This reverts commit 38fb04fab3
, reversing
changes made to 992fb9f935
.
Conflicts:
README.rdoc
spec/models/active_record/scopes_spec.rb
2013-06-18 22:30:05 +09:00
Yuki Nishijima
0a20c22aed
Revert "Merge pull request #320 from bricker/fix_nil_math_errors"
...
This reverts commit d63ac017a9
, reversing
changes made to f77fae765a
.
Conflicts:
lib/kaminari/models/page_scope_methods.rb
spec/models/active_record/scopes_spec.rb
2013-06-18 22:24:42 +09:00
Yuki Nishijima
8e48e45aa5
Add #out_of_range? method
...
closes #306 , and closes #366
2013-06-18 22:10:43 +09:00
Yuki Nishijima
2ac0c19a64
Add next_page and prev_page methods
...
closes #237
2013-06-17 17:50:11 +09:00
negipo
15ea8867c9
Add failing tests with padding
2013-04-14 21:32:46 +09:00
Bryan Ricker
873dcf9a90
Fix coercion error when offset_value is nil
...
This commit does two things:
* Adds `.offset(0)` when limit is set to `nil` for consistency
* Force-returns `1` for `#total_pages` and `#current_page` when
using `per(nil)`. This avoid "Cannot coerce nil into Fixnum"
errors, and will also prevent "ZeroDivisionError" if
`limit_value` is ever typecast using `to_i`.
2012-12-10 18:02:56 -08:00
Akira Matsuda
38fb04fab3
Merge pull request #304 from bricker88/nil_for_per
...
Allow nil for #per, to return records without limit (like ActiveRelation#limit)
2012-11-26 05:31:28 -08:00
Bryan Ricker
949f345a50
Allow nil for #per, to return records without limit
2012-10-31 18:02:52 -07:00
Zbigniew Pieslak
13bc89a554
Add tests for max_pages and max_pages_per
2012-10-22 16:16:54 +02:00
Akira Matsuda
e79935c2d5
num_pages => total_pages
2012-05-25 15:31:53 +09:00
Akira Matsuda
854d04af4b
[AR, DM, Mongoid, MongoMapper].each {|orm| run orm specs only if orm is loaded }
2012-05-23 12:38:30 +09:00
Akira Matsuda
53bae068e8
categorize model specs
2012-05-23 12:35:38 +09:00