mirror of
				https://github.com/kaminari/kaminari.git
				synced 2022-11-09 13:44:37 -05:00 
			
		
		
		
	Merge pull request #634 from kouyaf77/bugfix
Fixed a bug where paginates_per does not work with subclasses on mongoid
This commit is contained in:
		
							parent
							
								
									a99068ead9
								
							
						
					
					
						commit
						5db0781a6a
					
				
					 3 changed files with 42 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -207,5 +207,17 @@ if defined? Mongoid
 | 
			
		|||
        its(:total_pages) { should == 2 }
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    describe '#paginates_per' do
 | 
			
		||||
      context 'when paginates_per is not defined in superclass' do
 | 
			
		||||
        subject { Product.all.page 1 }
 | 
			
		||||
        its(:limit_value) { should == 25 }
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      context 'when paginates_per is defined in subclass' do
 | 
			
		||||
        subject { Device.all.page 1 }
 | 
			
		||||
        its(:limit_value) { should == 100 }
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue