enum_help 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da7e2ccf08926cc86540d06e331f2bfe82c71634
4
- data.tar.gz: f17dc5c72314bcc6551d68e3d737cdda82de0d0d
3
+ metadata.gz: 8f384a872b8a965d2c3c1e3213d957f56f2f81ce
4
+ data.tar.gz: 47733a81ef522b6df322c9a8be6b78097c85bb67
5
5
  SHA512:
6
- metadata.gz: 9266b252cbb1087318c363a7bba5617418060071f3063268ca61c91aab464440aafb5aad6049b066d86d58e1c2fa3545741f09856791a4eee8a73fb3086c1b5c
7
- data.tar.gz: fd97e84192133b762a65e4bed61c2dda446aa067a9547d741ddc2c3b03c56a61d3169c717045625baac452786ef75c90a22518e24b51d3beb5680539591df64e
6
+ metadata.gz: dc36a1846a9e2718181175e430c2ffee181422d40c84d25b23526cd01d969f41ff1c05bb78c0dd1f2ef06bb30e8e54cacabb851f66d036af7b847abe1bc029ae
7
+ data.tar.gz: 1e4136f604af3825a3f2473865a0b7efb52b62a45d2acc577a5e9de6f5bc1a1f9f567e66d0b3f0db8579f1bcce7386516ceb95883375ea720facef144dd5d249
@@ -10,7 +10,11 @@ module EnumHelp
10
10
  i18n_method_name = "#{name}_i18n".to_sym
11
11
  define_method(i18n_method_name) do
12
12
  enum_value = self.send(name)
13
- ::I18n.t("enums.#{klass.to_s.underscore}.#{name}.#{enum_value}", default: enum_value)
13
+ if enum_value
14
+ ::I18n.t("enums.#{klass.to_s.underscore}.#{name}.#{enum_value}", default: enum_value)
15
+ else
16
+ nil
17
+ end
14
18
  end
15
19
  end
16
20
  end
@@ -1,3 +1,3 @@
1
1
  module EnumHelp
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enum_help
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lester Zhao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-05 00:00:00.000000000 Z
11
+ date: 2014-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler