coupons icon indicating copy to clipboard operation
coupons copied to clipboard

Doesn't seem to work with Kaminari

Open cabgfx opened this issue 9 years ago • 2 comments

If I use Kaminari as my pagination library, as per b66d261abcb210045b8414974928bd67c604c0f8, I get a:

undefined method 'paginate' for #<ActiveRecord::Relation []>

I just specified gem 'kaminari' in my Gemfile, haven't done anything else. Is there something I'm missing?

Full trace here

cabgfx avatar Oct 11 '15 21:10 cabgfx

I have experienced this before. Putting kaminari before coupon in gemfile seem fixed this issue:

gem 'kaminari', '~> 0.16.3' gem 'coupons', '~> 0.0.0', :git => 'https://github.com/fnando/coupons.git'

thattimc avatar Nov 29 '15 09:11 thattimc

I also agree this does not work with kaminari : @paginator = if pagination_adapter == :kaminari -> relation, page { relation.page(page).per(Coupons.configuration.per_page) } else -> relation, page { relation.paginate(page: page, size: Coupons.configuration.per_page) } end Raw

This line in particular : -> relation, page { relation.page(page).per(Coupons.configuration.per_page) }

renegadeandy avatar Aug 15 '16 01:08 renegadeandy