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]
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