fix issue #243 (Kaminari causing error on Bushido)

This commit is contained in:
did 2011-11-05 15:18:15 +01:00
parent e309b62386
commit a3f66e19b5
3 changed files with 18 additions and 13 deletions

View File

@ -6,6 +6,7 @@ require 'locomotive/core_ext'
require 'locomotive/configuration'
require 'locomotive/logger'
require 'locomotive/dragonfly'
require 'locomotive/kaminari'
require 'locomotive/liquid'
require 'locomotive/mongoid'
require 'locomotive/carrierwave'

View File

@ -0,0 +1,17 @@
require 'kaminari'
module Kaminari
class PaginatableArray < Array
def to_liquid(options = {})
{
:collection => to_a,
:current_page => current_page,
:previous_page => first_page? ? nil : current_page - 1,
:next_page => last_page? ? nil : current_page + 1,
:total_entries => total_count,
:total_pages => num_pages,
:per_page => limit_value
}
end
end
end

View File

@ -1,13 +0,0 @@
class Kaminari::PaginatableArray
def to_liquid(options = {})
{
:collection => to_a,
:current_page => current_page,
:previous_page => first_page? ? nil : current_page - 1,
:next_page => last_page? ? nil : current_page + 1,
:total_entries => total_count,
:total_pages => num_pages,
:per_page => limit_value
}
end
end