about summary refs log tree commit diff
path: root/app/controllers/settings/preferences_controller.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-16 17:51:02 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-16 17:56:31 +0100
commit2c766bd4b4c6dcf8e7c9a6dd9421edca0de57aba (patch)
treed84f472de5ff84502928fec8582be492c45a6faf /app/controllers/settings/preferences_controller.rb
parent01e43c3e5799b575a70798056945365ddf51f3ad (diff)
Add user locale setting
Diffstat (limited to 'app/controllers/settings/preferences_controller.rb')
-rw-r--r--app/controllers/settings/preferences_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb
index 4dc2cd61f..5be8719ae 100644
--- a/app/controllers/settings/preferences_controller.rb
+++ b/app/controllers/settings/preferences_controller.rb
@@ -14,7 +14,7 @@ class Settings::PreferencesController < ApplicationController
     current_user.settings(:notification_emails).favourite = user_params[:notification_emails][:favourite] == '1'
     current_user.settings(:notification_emails).mention   = user_params[:notification_emails][:mention]   == '1'
 
-    if current_user.save
+    if current_user.update(user_params.except(:notification_emails))
       redirect_to settings_preferences_path, notice: I18n.t('generic.changes_saved_msg')
     else
       render action: :show
@@ -24,6 +24,6 @@ class Settings::PreferencesController < ApplicationController
   private
 
   def user_params
-    params.require(:user).permit(notification_emails: [:follow, :reblog, :favourite, :mention])
+    params.require(:user).permit(:locale, notification_emails: [:follow, :reblog, :favourite, :mention])
   end
 end