localyzed 0.0.3.8 → 0.0.3.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,12 +11,12 @@ module Localyzed::LocalyzedController
11
11
 
12
12
  # sets the locale by checking user data then request param then session data then retrieving accept language data
13
13
  def set_locale
14
- cl = ( ( respond_to?(:user_signed_in?) && current_user.try(:respond_to?,:language) ) ? current_user.language : 'en')
14
+ cl = ( ( respond_to?(:user_signed_in?) && current_user.try(:user_profile).try(:respond_to?,:language) ) ? current_user.user_profile.language : 'en')
15
15
  if params[:locale].nil? and user_signed_in? and cl and I18n.available_locales.include?(cl)
16
16
  locale = I18n.locale = cl
17
17
  session[:locale] = locale
18
18
  else
19
- current_user.try(:update_attributes,{:language => params[:locale]}) if params[:locale] && cl.try(:!=, params[:locale])
19
+ current_user.try(:user_profile).try(:update_attributes,{:language => params[:locale]}) if params[:locale] && cl.try(:!=, params[:locale])
20
20
  define_locale
21
21
  end
22
22
  end
@@ -1,3 +1,3 @@
1
1
  module Localyzed
2
- VERSION = "0.0.3.8"
2
+ VERSION = "0.0.3.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: localyzed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.8
4
+ version: 0.0.3.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: