mess around with api params
This commit is contained in:
parent
d32bfc55fb
commit
dbc533a1cb
1 changed files with 8 additions and 2 deletions
|
@ -22,7 +22,13 @@ class TransactionsController < ApplicationController
|
|||
|
||||
private
|
||||
|
||||
def transaction_params
|
||||
params.require(:transaction).permit(:creditor_id, :amount, :message)
|
||||
def set_params
|
||||
t = params.require(:transaction)
|
||||
.permit(:debtor, :creditor, :amount, :message)
|
||||
|
||||
t.update {
|
||||
debtor: User.find_by(name: t[:debtor]) || User.zeus,
|
||||
creditor: User.find_by(name: t[:creditor]) || User.zeus
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue