1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00
Commit graph

14 commits

Author SHA1 Message Date
Zhomart Mukhamejanov
fb58fb2f9e MongoidCriteriaMethods#total_count uses :size instead of :count 2014-08-13 20:01:19 -07:00
Yuki Nishijima
37202e4823 Reset @total_count on #clone
Fixes #565
2014-06-23 12:12:02 -07:00
Yuki Nishijima
584c3ba1aa Eliminate unneeded local variable in MongoidCriteriaMethods
* #count already caches the result
 * change indent
 * we prefer && to `and`
2014-03-19 19:16:54 -07:00
Yuki Nishijima
507fb73b09 Simplify page_entries_info by adding entry_name interface to each ORM 2014-03-16 11:21:26 -07:00
aptx4869
88c163eb06 Add support for mongoid max_scan option
respect the max_scan option in criteria

cache the total_count in the collection instance
prevent hitting db again in the same instance
2014-01-26 09:21:35 +08:00
Campbell Allen
3796e3071c use the mongoid criteria length to cache the count of the collection per criteria
Fixes slow pagination into large mongoid collections as the criteria method didn't cache the count. ActionViewExtension#page_entries_info calls total_count 3 or 4 times (depending on execution path), slowing the view render.

http://mongoid.org/en/mongoid/docs/querying.html

Criteria#length, Also size. Get a count of persisted documents. After being called once for the criteria, will cache subsequent calls and not hit the database.
2013-12-05 13:09:40 +00:00
Akira Matsuda
93053d26ee refactor page_entries_info not to use buggy current_page_count method 2012-05-15 22:19:24 +09:00
Forrest Ye
6ad1e08e88 remove several trailing whitespaces 2012-05-14 23:45:33 +08:00
dblock
011adedfec Fixing displayed number of items on each page w/ Mongoid 2.4.x and MongoMapper. 2012-01-11 13:38:45 -05: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
Yuki Nishijima
4276a2c4b3 enable to paginate throurh embedded documents in mongoid 2011-08-25 06:30:45 +09:00
Akira Matsuda
9b0c4c6301 cosme 2011-02-21 04:05:52 +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
Renamed from lib/kaminari/mongoid_criteria_methods.rb (Browse further)