mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 05:09:38 +02:00
Introduces a basic CSV import module for bulk-importing account transactions. Changes include: - User can load a CSV - User can configure the column mappings for a CSV - Imported CSV shows invalid cells - User can clean up their data directly in the UI - User can see a preview of the import rows and confirm import - Layout refactor + Import nav stepper - System test stability improvements
26 lines
779 B
Ruby
26 lines
779 B
Ruby
class Settings::PreferencesController < SettingsController
|
|
def edit
|
|
end
|
|
|
|
def update
|
|
preference_params_with_family = preference_params
|
|
|
|
if Current.family && preference_params[:family_attributes]
|
|
family_attributes = preference_params[:family_attributes].merge({ id: Current.family.id })
|
|
preference_params_with_family[:family_attributes] = family_attributes
|
|
end
|
|
|
|
if Current.user.update(preference_params_with_family)
|
|
redirect_to settings_preferences_path, notice: t(".success")
|
|
else
|
|
redirect_to settings_preferences_path, notice: t(".success")
|
|
render :show, status: :unprocessable_entity
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def preference_params
|
|
params.require(:user).permit(family_attributes: [ :id, :currency ])
|
|
end
|
|
end
|