lib/sinatra/pagers.rb
def adjust_page_order(dataset)
        @n_records=dataset.count
        dataset=dataset.offset((@page-1)*@cpp).limit(@cpp)
        if @order
          order_o= (@order_dir=='asc') ? @order_col.to_sym : Sequel.desc(@order_col.to_sym)
          dataset=dataset.order(order_o)
        end
        dataset
      end
# Retrieves the records to be shown, adjusting by page and order
Retrieves the records to be shown, adjusting by page and order
Retrieves the records to be shown adjusting by page and order
def adjust_page_order(dataset)
        @n_records=dataset.count
        dataset=dataset.offset((@page-1)*@cpp).limit(@cpp)
        if @order
          order_o= (@order_dir=='asc') ? @order_col.to_sym : Sequel.desc(@order_col.to_sym)
          dataset=dataset.order(order_o)
        end
        dataset
      end
def adjust_page_order ( dataset ) @n_records = dataset . count dataset = dataset . offset ( ( @page - 1 ) * @cpp ) . limit ( @cpp ) if @order order_o = ( @order_dir == 'asc' ) ? @order_col . to_sym : Sequel . desc ( @order_col . to_sym ) dataset = dataset . order ( order_o ) end dataset end
Retrieves the records to be shown, adjusting by page and order
Retrieves the records to be shown adjusting by page and order
dataset