module Grasshopper::Paginate::ActiveRecord::Pagination
Public Instance Methods
smart_paginate(options={})
click to toggle source
# File lib/grasshopper_paginate/active_record.rb, line 8 def smart_paginate(options={}) per_page = options[:per_page] || self.per_page options[:per_page] = (per_page*1.5).to_i if self.count <= per_page*1.5 paginate options end