scope :start_date, -> start_date { where("date >= ?", start_date) }
scope :end_date, -> end_date { where("date <= ?", end_date) }
class OrdersController < ApplicationController
has_scope :code
has_scope :start_date
has_scope :end_date
def index
@orders = apply_scopes(Order)
.page(params[:page])
.per(get_per)
end
end