Displaying 2 results from an estimated 2 matches for "count_from_query".
2007 Apr 04
1
[PLUGIN] count_from_query - easily convert finder queries into count queries
count_from_query gives you the ability to generate a COUNT query from
a standard Rails find.
For example, if you have the query
User.find :all
it would be trivial to get a count:
User.count
however, if you have a more specific finder method, such as
class Company < ActiveRecord::Base
def complete_videos
Vi...
2007 Apr 04
2
[PLUGIN] ArPaginator - Allows you to easily paginate over any existing AR queries.
..."created_at DESC"
end
end
then the pagination would fail. This is because Rails seems to ignore
the :limit option when using with_scope around an association proxy.
You would have to convert that code to not use the association proxy,
as in the first example.
This plugin requires the count_from_query plugin
ruby script/plugin install svn://evang.eli.st/public/plugins/count_from_query
ruby script/plugin install svn://evang.eli.st/public/plugins/ar_paginator
Released under the MIT License
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed...