fix issue #243 (Kaminari causing error on Bushido)
This commit is contained in:
parent
e309b62386
commit
a3f66e19b5
@ -6,6 +6,7 @@ require 'locomotive/core_ext'
|
|||||||
require 'locomotive/configuration'
|
require 'locomotive/configuration'
|
||||||
require 'locomotive/logger'
|
require 'locomotive/logger'
|
||||||
require 'locomotive/dragonfly'
|
require 'locomotive/dragonfly'
|
||||||
|
require 'locomotive/kaminari'
|
||||||
require 'locomotive/liquid'
|
require 'locomotive/liquid'
|
||||||
require 'locomotive/mongoid'
|
require 'locomotive/mongoid'
|
||||||
require 'locomotive/carrierwave'
|
require 'locomotive/carrierwave'
|
||||||
|
17
lib/locomotive/kaminari.rb
Normal file
17
lib/locomotive/kaminari.rb
Normal 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
|
@ -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
|
|
Loading…
Reference in New Issue
Block a user