class Dunlop::ExecutionBatchesController < Dunlop::ApplicationController
  respond_to :html

  def index
    authorize! :index, ExecutionBatch
    @q = ExecutionBatch.search(query)
    @q.sorts = 'created_at desc' if @q.sorts.empty?
    @batches = @q.result.page(params[:page])
    respond_with(@batches)
  end

  def show
    @record = ExecutionBatch.find(params[:id])
    authorize! :show, @record
    respond_with(@record)
  end

end
