Skip to content
This repository has been archived by the owner on Mar 10, 2018. It is now read-only.

Doesn't seem to work with Kaminari #11

Open
cabgfx opened this issue Oct 11, 2015 · 2 comments
Open

Doesn't seem to work with Kaminari #11

cabgfx opened this issue Oct 11, 2015 · 2 comments

Comments

@cabgfx
Copy link
Contributor

cabgfx commented Oct 11, 2015

If I use Kaminari as my pagination library, as per b66d261, 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

@thattimc
Copy link

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'

@renegadeandy
Copy link

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) }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants