localyzed 0.0.3.7 → 0.0.3.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,8 @@ 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
- if params[:locale].nil? and user_signed_in? and cl = (current_user.respond_to?(:language) ? current_user.language : 'en') and I18n.available_locales.include?(cl)
14
+ cl = ( ( respond_to?(:user_signed_in?) && current_user.try(:respond_to?,:language) ) ? current_user.language : 'en')
15
+ if params[:locale].nil? and user_signed_in? and cl and I18n.available_locales.include?(cl)
15
16
  locale = I18n.locale = cl
16
17
  session[:locale] = locale
17
18
  else
@@ -1,3 +1,3 @@
1
1
  module Localyzed
2
- VERSION = "0.0.3.7"
2
+ VERSION = "0.0.3.8"
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.7
4
+ version: 0.0.3.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-06 00:00:00.000000000 Z
12
+ date: 2013-02-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails