1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

Fixed a 'stack level too deep' bug in mongoid

Fixes #642
This commit is contained in:
Yuki Nishijima 2015-01-24 12:35:59 -08:00
parent 72d84b462e
commit 0e95118b74
3 changed files with 10 additions and 1 deletions

View file

@ -20,7 +20,7 @@ module Kaminari
kls.send(:include, Kaminari::MongoidExtension::Document.dup)
end
alias_method_chain :inherited, :kaminari
end
end unless respond_to?(:inherited_with_kaminari)
end
end
end

View file

@ -20,6 +20,10 @@ class Device < Product
paginates_per 100
end
class Android < Device
paginates_per 200
end
class MongoMongoidExtensionDeveloper
include ::Mongoid::Document
field :salary, :type => Integer

View file

@ -218,6 +218,11 @@ if defined? Mongoid
subject { Device.all.page 1 }
its(:limit_value) { should == 100 }
end
context 'when paginates_per is defined in subclass of subclass' do
subject { Android.all.page 1 }
its(:limit_value) { should == 200 }
end
end
end
end