mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-29 18:19:39 +02:00
Remove currency conversion job call (#566)
This commit is contained in:
parent
110855d077
commit
d402f4d6ba
1 changed files with 1 additions and 6 deletions
|
@ -6,17 +6,12 @@ class SettingsController < ApplicationController
|
||||||
|
|
||||||
def update
|
def update
|
||||||
user_params_with_family = user_params
|
user_params_with_family = user_params
|
||||||
# Ensure we're only updating the family associated with the current user
|
|
||||||
if Current.family
|
if Current.family
|
||||||
family_attributes = user_params_with_family[:family_attributes].merge({ id: Current.family.id })
|
family_attributes = user_params_with_family[:family_attributes].merge({ id: Current.family.id })
|
||||||
user_params_with_family[:family_attributes] = family_attributes
|
user_params_with_family[:family_attributes] = family_attributes
|
||||||
end
|
end
|
||||||
|
|
||||||
# If the family attribute for currency is changed, we need to convert all account balances to the new currency with the ConvertCurrencyJob job
|
|
||||||
if user_params_with_family[:family_attributes][:currency] != Current.family.currency
|
|
||||||
ConvertCurrencyJob.perform_later(Current.family)
|
|
||||||
end
|
|
||||||
|
|
||||||
if Current.user.update(user_params_with_family)
|
if Current.user.update(user_params_with_family)
|
||||||
redirect_to root_path, notice: "Profile updated successfully."
|
redirect_to root_path, notice: "Profile updated successfully."
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue