Module: Enki::PaginationShim

Included in:
Base::Post, Comment, Page
Defined in:
lib/enki/pagination_shim.rb

Instance Method Summary collapse

Instance Method Details

#paginated(params) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/enki/pagination_shim.rb', line 4

def paginated(params)
  if defined? ::Kaminari
    page params[:page]
  elsif defined? ::WillPagniate
    paginate :page => params[:page]
  else
    all
  end
end

#paginated_pagesObject



14
15
16
17
18
19
20
21
22
# File 'lib/enki/pagination_shim.rb', line 14

def paginated_pages
  if defined? ::Kaminari
    num_pages
  elsif defined? ::WillPagniate
    total_pages
  else
    1
  end
end