will_paginate & ambition? count method seems incompatible

9 views
Skip to first unread message

csmosx

unread,
Jul 30, 2009, 5:45:48 PM7/30/09
to ambition.rb
Hi,

I'm using:
ambition-0.5.4
ambitious-activerecord-0.1.3
mislav-will_paginate-2.3.11

Will_paginate won't print pagination links on my pages, when using
Ambition.
It thinks my collections have a total_entries size of zero.
I am new to Ambition, any help would be appreciated...

Using ambition I get this:
>> guh = Broker.paginate(:page => nil, :per_page => 5)
=> [<the result>]
>> guh.total_entries
=> 0

Without ambition (standard AR):
>> guh = Broker.paginate(:page => nil, :per_page => 5)
=> [<the result>]
>> guh.total_entries
=> 20

I figure this must have something to do with the count method...

With ambition, I get:
>> Broker.count
=> 0
>> Broker.all.count
=> 20

Without ambition (standard AR):
>> Broker.count
=> 20

Thanks!

Ben Hoskings

unread,
Jul 30, 2009, 9:08:53 PM7/30/09
to ambit...@googlegroups.com
I ran into similar problems; I've fixed some #count-related stuff in
my fork:

http://github.com/benhoskings/ambition

Cheers
Ben

Chris Merritt

unread,
Jul 31, 2009, 1:42:20 PM7/31/09
to ambit...@googlegroups.com
Thanks Ben, your fork seems to have fixed it and is working well.
I thank you.
Reply all
Reply to author
Forward
0 new messages