lists_constant 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,7 +44,7 @@ module ListsConstant
44
44
  field = @field
45
45
 
46
46
  base.define_singleton_method "localized_#{field.singularize}" do |value|
47
- send(field)[value.to_sym] unless value.nil?
47
+ ListsConstant::Lookup.new(self, field).lookup(value)
48
48
  end
49
49
  end
50
50
 
@@ -1,3 +1,3 @@
1
1
  module ListsConstant
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -47,6 +47,7 @@ describe ListsConstant::Lookups::Class do
47
47
  it "localizes passed values" do
48
48
  assert_equal Lister.localized_color(:red), @translations[:red]
49
49
  assert_equal Lister.localized_color('blue'), @translations[:blue]
50
+ assert_equal Lister.localized_color(:magenta), nil
50
51
  end
51
52
 
52
53
  it "generates an inverted hash for option helpers" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lists_constant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: