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
Akira Matsuda
d23564457c
Reduce Ruby ⚠️ s
2013-04-23 22:43:05 +09:00
Gordeev Vladimir
855f85e56b
Fix wrong pagination when used with padding
2013-02-22 00:51:58 +03: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
c1807031ac
Add max_pages and max_pages_per methods to limit displayed pages per model or globally
2012-10-19 19:35:26 +02:00
Keiko Oda
7af1e87db4
Change default value of max_per_page from 0 to nil
2012-08-28 00:54:45 -07:00
Keiko Oda
c77867681e
Add max_per_page configuration option
2012-08-27 22:15:19 -07:00
Akira Matsuda
8ca1a41740
keep compatibility with previous versions for now
2012-05-25 15:32:49 +09:00
Akira Matsuda
e79935c2d5
num_pages => total_pages
2012-05-25 15:31:53 +09:00
Akira Matsuda
27a4e6076b
fixes #180 avoid the unnecessary "yo dawg, I heard you like include, so I put a module that includes your module when it is included" approach when building extensions
...
using InstanceMethods is deprecated since 401393b656
2011-12-12 00:14:52 +09:00
Akira Matsuda
e79bad5b46
rename Relation#shift to padding
...
bacause this method name was turned out to be stubbing out Array#shift
2011-12-02 23:54:34 +09:00
Akira Matsuda
abe9cdc334
rename Relation#skip to shift
...
bacause this method name overlaps with MongoDB's skip() function
2011-08-21 08:38:41 +09:00
Aaron Jensen
5575beb2ee
Adding skip method to skip an arbitrary record count
...
Can be used in conjunction with page and per to offset by an
amount less than the page size.
2011-08-18 01:57:03 +09:00
Akira Matsuda
fe5df577f3
whitespace
2011-04-25 17:14:28 +09:00
Aurélien AMILIN
81b508d80a
fix last_page?
2011-04-25 17:14:09 +09:00
Aurélien AMILIN
b61d5a6568
last_page? and first_page? added
2011-04-25 17:11:02 +09:00
Akira Matsuda
b81bdcb024
a bit more meaningful method name
2011-02-21 03:58:35 +09:00
Akira Matsuda
60a91a9667
digging a directory and moving files into it makes me feel like being Lode Runner...
2011-02-21 03:23:14 +09:00