Refactor user preferences, add defaults from file
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Update release notes draft

* Turn prefs into a flat hash structure, since nesting is not worth the
trouble
* Add a custom serializer class for prefs
* Add a config file for defaults and merge set prefs with unset ones
* Use booleans for "true" and "false", and integers where appropriate
This commit is contained in:
Râu Cao
2023-04-05 16:56:14 +02:00
parent ca7475dca2
commit 4e2e13108c
10 changed files with 88 additions and 69 deletions
+2 -2
View File
@@ -45,8 +45,8 @@ class SettingsController < ApplicationController
def user_params
params.require(:user).permit(preferences: [
lightning: [:notify_sats_received],
xmpp: [:exchange_contacts_with_invitees]
:lightning_notify_sats_received,
:xmpp_exchange_contacts_with_invitees
])
end
end