app/controllers/api/v1/transactions_controller.rb
# Only allow a list of trusted parameters through.
Only allow a list of trusted parameters through.
Only allow a list of trusted parameters through .
def transaction_params
    defaults = { customer_id: current_customer.id }
    meta_keys = params.require(:transaction).fetch(:meta, {}).keys
    params.require(:transaction).permit(:to_account_id, :account_id, :transaction_type, :notes, :amount, meta: meta_keys).reverse_merge(defaults)
  end
def transaction_params defaults = { customer_id : current_customer . id } meta_keys = params . require ( :transaction ) . fetch ( :meta , { } ) . keys params . require ( :transaction ) . permit ( :to_account_id , :account_id , :transaction_type , :notes , :amount , meta : meta_keys ) . reverse_merge ( defaults ) end
Only allow a list of trusted parameters through.
Only allow a list of trusted parameters through .