locale_setter 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  module LocaleSetter
2
2
  module User
3
3
  def self.for(user)
4
- if user && user.locale && !user.locale.empty?
4
+ if user && user.respond_to?(:locale) && user.locale && !user.locale.empty?
5
5
  LocaleSetter::Matcher.match(user.locale)
6
6
  end
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module LocaleSetter
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -13,8 +13,8 @@ describe 'LocaleSetter::User' do
13
13
  end
14
14
 
15
15
  it "only tries current_user if it offers a locale" do
16
- no_locale = OpenStruct.new()
17
- LocaleSetter::User.for(no_locale).should_not be
16
+ class NoLocaleUser; end
17
+ LocaleSetter::User.for(NoLocaleUser.new).should_not be
18
18
  end
19
19
  end
20
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locale_setter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: