Fixed Default Locale

This commit is contained in:
saurabhbhatia 2013-12-02 13:24:41 +08:00
parent a433f4f9a4
commit d0d6a4147e
1 changed files with 6 additions and 1 deletions

View File

@ -21,9 +21,14 @@ class Admin::SitesController < OrbitBackendController
end
def update
if params[:site][:enable_language_detection]
if params[:site][:default_locale] && @site.enable_language_detection.eql?(true)
Site.update_all({:enable_language_detection => false})
elsif params[:site][:enable_language_detection]
Site.update_all({:default_locale => nil})
end
# if params[:site][:enable_language_detection]
# Site.update_all({:default_locale => nil})
# end
@site.update_attributes(params[:site])
redirect_to :back
end