Class: Cats::Core::StackTransactionsController
Instance Method Summary
collapse
Methods included from Common
#create, #show, #update
#authenticate, #current_user, #skip_bullet
Instance Method Details
#commit ⇒ Object
18
19
20
21
22
|
# File 'app/controllers/cats/core/stack_transactions_controller.rb', line 18
def commit
transaction = set_object
transaction.commit
render json: {success: true, data: serialize(transaction)}
end
|
#filter ⇒ Object
13
14
15
16
|
# File 'app/controllers/cats/core/stack_transactions_controller.rb', line 13
def filter
query = StackTransaction.includes(:source, :destination, :unit).ransack(params[:q])
render json: {success: true, data: serialize(query.result)}
end
|
#index ⇒ Object
6
7
8
9
10
11
|
# File 'app/controllers/cats/core/stack_transactions_controller.rb', line 6
def index
super do
StackTransaction.includes(:unit, :destination, source: :store)
.where(cats_core_stacks: {cats_core_stores: {warehouse_id: params[:id]}})
end
end
|