From 5cf2fc4ab18ddbdf1bb31335f461ae014a8f8234 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Sat, 15 Aug 2015 07:20:20 +0300 Subject: [PATCH] Update locale for signed in users --- app/controllers/application_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4a87bd1..656b416 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -24,6 +24,9 @@ class ApplicationController < ActionController::Base def set_locale I18n.locale = params[:locale] || I18n.default_locale + if user_signed_in? and current_user.language != I18n.locale + current_user.update(language: I18n.locale) + end end def set_view_paths