Class: Sequel::Model

Inherits:
Object
  • Object
show all
Defined in:
lib/easycomments/ec_pagination.rb

Class Method Summary collapse

Class Method Details

.page(page, per_page = COMMENTS_PER_PAGE || 10, *args) ⇒ Object



5
6
7
8
9
# File 'lib/easycomments/ec_pagination.rb', line 5

def self.page(page, per_page=COMMENTS_PER_PAGE || 10, *args)
  page = page.to_i
  page = 1 if page < 1
  dataset.paginate(page, per_page, *args)
end