Class: Cats::Core::ReceiptTransactionsController

Inherits:
ApplicationController show all
Includes:
Common
Defined in:
app/controllers/cats/core/receipt_transactions_controller.rb

Instance Method Summary collapse

Methods included from Common

#create, #show, #update

Methods inherited from ApplicationController

#authenticate, #current_user, #skip_bullet

Instance Method Details

#filterObject



13
14
15
16
# File 'app/controllers/cats/core/receipt_transactions_controller.rb', line 13

def filter
  query = ReceiptTransaction.ransack(params[:q])
  render json: {success: true, data: serialize(query.result)}
end

#indexObject



6
7
8
9
10
11
# File 'app/controllers/cats/core/receipt_transactions_controller.rb', line 6

def index
  super do
    ReceiptTransaction.includes(:destination, {receipt_authorization: :dispatch}, :unit)
                      .where(receipt_authorization_id: params[:id])
  end
end