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

fix issue#276

This commit is contained in:
Eito Katagiri 2012-09-03 01:00:31 +09:00
parent dfd380d0bb
commit cd0ee29e02
2 changed files with 9 additions and 1 deletions

View file

@ -88,7 +88,7 @@ module Kaminari
def page_entries_info(collection, options = {})
entry_name = if options[:entry_name]
options[:entry_name]
elsif collection.empty?
elsif collection.empty? || collection.is_a?(PaginatableArray)
'entry'
else
if collection.respond_to? :model # DataMapper

View file

@ -214,6 +214,14 @@ describe 'Kaminari::ActionViewExtension' do
end
end
end
context 'on a PaginatableArray' do
before do
@numbers = Kaminari.paginate_array(%w{one two three}).page(1)
end
subject { helper.page_entries_info @numbers }
it { should == 'Displaying <b>all 3</b> entries' }
end
end
describe '#rel_next_prev_link_tags' do