simple_enum 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,3 +1,4 @@
1
+ language: ruby
1
2
  env:
2
3
  - ORM=active_record
3
4
  - ORM=mongoid
@@ -7,4 +8,4 @@ rvm:
7
8
  gemfile:
8
9
  - gemfiles/rails-3.0.gemfile
9
10
  - gemfiles/rails-3.1.gemfile
10
- - gemfiles/rails-3.2.gemfile
11
+ - gemfiles/rails-3.2.gemfile
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_enum (1.5.0)
4
+ simple_enum (1.5.1)
5
5
  activesupport (>= 3.0.0)
6
6
 
7
7
  GEM
data/lib/simple_enum.rb CHANGED
@@ -209,7 +209,7 @@ module SimpleEnum
209
209
  enum_attr = :"#{attr_name.downcase}_enum_hash"
210
210
 
211
211
  define_method("human_#{enum_cd}") do
212
- self.class.human_enum_name(attr_name, self.send(enum_cd))
212
+ self.class.human_enum_name(attr_name, self.send(enum_cd)) unless self.send(enum_cd).nil?
213
213
  end
214
214
 
215
215
  class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
@@ -1,5 +1,5 @@
1
1
  module SimpleEnum
2
2
 
3
3
  # +SimpleEnum+ version string.
4
- VERSION = "1.5.0"
4
+ VERSION = "1.5.1"
5
5
  end
@@ -232,4 +232,9 @@ class SimpleEnumTest < MiniTest::Unit::TestCase
232
232
  ActiveSupport::Deprecation.behavior = original_behavior
233
233
  end
234
234
  end
235
+
236
+ def test_human_name_for_nil_value
237
+ d = Dummy.new
238
+ assert_nil(d.human_gender)
239
+ end
235
240
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_enum
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
- - 0
10
- version: 1.5.0
9
+ - 1
10
+ version: 1.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Lukas Westermann
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-04-10 00:00:00 Z
18
+ date: 2012-04-26 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  type: :runtime