Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
124 lines (97 sloc) 6.16 KB
* Fixed page out-of-range bug, and another small bug when only one page exists, in paginating_links_helper. Thanks to Pawel Stradomski.
* Count query now uses the :from find option, if specified. Thanks to Rich Wertz.
* Removed extraneous statement from collect_count_options. Thanks to Wolfgang Postler.
* Count query now respects the distinct keyword if it is included in the :select option. Thanks to Luke Pearce.
* PagingEnumerator#each now returns self. Thanks to Takeru Sasaki.
* Addeed #to_xml to the PagingEnumerator.
* No longer overwrite the AR #validate_find_options method. Instead just append :page to VALID_FIND_OPTIONS. Thanks for the suggestion Pratik.
* Fixed a bug in handling the HAVING having clause. Thanks to Daniel Aborg for the patch!
* Added support for Array#extract_options! added to Rails edge (9087). Thanks to Alex Payne!
* Tests no longer use with_scope since it became protected in Rails edge.
* Now uses alias_method_chain. Thanks to Jeremy Larkin for the patch.
* PagingEnumerator now supports Marshal.dump and Marshal.load. When marshaled, the enumerator loses its callback, so :auto => true is not supported in this scenario.
* :current < 1 is now gracefully handled. Thanks again to Benjamin Curtis and 21st Century Music.
* Added paging_helper that provides paginating_links and paginating_links_each to ActionView::Base. Special thanks to Benjamin Curtis and 21st Century Music (!
* :first now defaults to 1 rather than the value of :page. Thanks to Jack Baty for bringing this to my attention.
* primary_key used to build count select statement rather than "id" column. Thanks to Rich Cox.
* Applied another fix to counting with :group option. Special thanks to Ben Weiner.
* Placed tests for grouping in a separate class.
* Removed rails from vendor directory.
* For purposes of counting, the HAVING statement is now extracted from the :group option as a convenience for users that are hacking around the lack of a AR#find :having option. Thanks to Gavin Joyce for pointing out this usage of :group. More info here:
* For purposes of counting, the :select option is now ignored in favor of Thanks to Aron Atkins for reporting a bug that led to this fix.
* Count query no longer uses :limit. This option doesn't have the same effect on count as it does on find. The :limit is applied to the count after the query is performed, if necessary.
* Count query no longer uses :group. Grouping during a count doesn't get any different count than not grouping.
* Count query no longer uses :order for the same reasons that :group is no longer used.
* Change log is now in reverse chronological order
* Count query now respects :group and :order. Previous changes removing this functionality are no longer applicable.
* Added :count option. Using this will cause the plugin to skip the automatic database count query (which can sometimes be slow).
* The :limit option no longer affects whether the count query will run.
* Fixed a bug reported by Lisa, where the count query was choking on grouped results. The count query now ignores :group.
* Scoping now works correctly, even when enumeration is done outside the #with_scope code block.
* Added the #empty? method.
* Added #first_item and #last_item, which return the index of the first and last items on the current page. Thanks, Ilya!
* Now works correctly :with_scope, nested :with_scope, and :include.
* Now correctly counts when querying on through associations.
* Rewrote paginating_find_test so that it uses real AR::Base models, rather than mocks.
* Trying out a bare-bones instance of rails in order to run tests without having to install the plugin.
* next_page? and previous_page? now return booleans rather than the page number. Thanks, Hammed.
* next_page and previous_page have been added.
* The total count now correctly respects conditions, includes, etc. Thanks, Ilya
* ArgumentError is now correctly thrown if options[:offset] is used. Thanks, jonni!
* :conditions are now correctly respected when paging is enabled
* :size now defaults to total number of records if less than ten.
* Added #last_page! method. Only works when :auto => true.
* Added #first_page! method. Only works when :auto => true.
* Added the #move!(page) method. Only works when :auto => true.
* Added the #previous_page!(page) method. Only works when :auto => true.
* Added the #page_exists?(page) method.
* The #load_page method is no longer protected.
* Fixed bug in #to_a that was causing :limit to be exceeded.
* An ArgumentError is now raised if both :page and :offset options are specified
* The first page and current page can be specified separately, using the :first and :current options respectively.
* Reversed semantics of automatic pagination. By default, the enumerator will stop after all records on current page. To enumerate all records, pass option :auto => true.
* :manual_paging is no longer supported. Use the :auto option instead. :auto defaults to false.
* All paging options are now specified in a hash, keyed by :page. This is mostly an aesthetics issue:
# The old way:
cogs = Cog.find(:all,
:limit => 3000,
:page_size => 10,
:page => 1,
:manual_paging => true)
# The new way:
cogs = Cog.find(:all,
:limit => 3000,
:page => {:size => 10,
:current => 1})
* The following :page options are supported in this revision:
:size => Number of records in each page of results. Defaults to 1/10
the total size if total size > 10, otherwise defaults to
the total size.
:current => The current page. Optional, defaults to the first page: 1.
:first => The first page. Optional, defaults to the current page.
:auto => Automatically load the next page during invocation of #each. Defaults to false.
Something went wrong with that request. Please try again.