coupons
coupons copied to clipboard
Doesn't seem to work with Kaminari
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?
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'
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) }