mirror of
https://github.com/we-promise/sure.git
synced 2026-04-18 03:24:09 +00:00
Fix transfers and form currencies (#1477)
This commit is contained in:
@@ -5,7 +5,10 @@ class Account::TradesController < ApplicationController
|
||||
before_action :set_entry, only: :update
|
||||
|
||||
def new
|
||||
@entry = @account.entries.account_trades.new(entryable_attributes: {})
|
||||
@entry = @account.entries.account_trades.new(
|
||||
currency: @account.currency,
|
||||
entryable_attributes: {}
|
||||
)
|
||||
end
|
||||
|
||||
def index
|
||||
|
||||
@@ -16,8 +16,7 @@ class Account::TransfersController < ApplicationController
|
||||
|
||||
@transfer = Account::Transfer.build_from_accounts from_account, to_account, \
|
||||
date: transfer_params[:date],
|
||||
amount: transfer_params[:amount].to_d,
|
||||
currency: transfer_params[:currency]
|
||||
amount: transfer_params[:amount].to_d
|
||||
|
||||
if @transfer.save
|
||||
@transfer.entries.each(&:sync_account_later)
|
||||
|
||||
@@ -4,7 +4,10 @@ class Account::ValuationsController < ApplicationController
|
||||
before_action :set_account
|
||||
|
||||
def new
|
||||
@entry = @account.entries.account_valuations.new(entryable_attributes: {})
|
||||
@entry = @account.entries.account_valuations.new(
|
||||
currency: @account.currency,
|
||||
entryable_attributes: {}
|
||||
)
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
Reference in New Issue
Block a user