From f9b6284df6ea204c9e666e785af88ae9e493546a Mon Sep 17 00:00:00 2001 From: Josep Jaume Rey Peroy Date: Fri, 22 Jan 2016 18:26:08 +0100 Subject: [PATCH] Explicitly check for different locale before updating --- app/controllers/application_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 94d818dca..346f6aa34 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -54,9 +54,8 @@ class ApplicationController < ActionController::Base locale = session[:locale] - if current_user - current_user.locale = locale - current_user.save + if current_user && current_user.locale != locale.to_s + current_user.update(locale: locale) end I18n.locale = locale