Explicitly check for different locale before updating

This commit is contained in:
Josep Jaume Rey Peroy
2016-01-22 18:26:08 +01:00
parent cf00f12ec7
commit f9b6284df6

View File

@@ -54,9 +54,8 @@ class ApplicationController < ActionController::Base
locale = session[:locale] locale = session[:locale]
if current_user if current_user && current_user.locale != locale.to_s
current_user.locale = locale current_user.update(locale: locale)
current_user.save
end end
I18n.locale = locale I18n.locale = locale