mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
parent
79af6ed986
commit
eff6d7fc29
3 changed files with 10 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue