From b2734933af2079fec4b90ac2d6a227d3c8794cda Mon Sep 17 00:00:00 2001 From: Pierpaolo Frasa Date: Sun, 28 Sep 2014 23:40:55 +0200 Subject: [PATCH] ensure ids are always assigned as integers --- lib/enum_table/reflection.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/enum_table/reflection.rb b/lib/enum_table/reflection.rb index 95ca18e..76ce461 100644 --- a/lib/enum_table/reflection.rb +++ b/lib/enum_table/reflection.rb @@ -34,6 +34,7 @@ def to_populate(&block) end def add_value(id, value) + id = id.to_i @strings_to_ids[value.to_s] = id cast_value = @type == :string ? value.to_s : value.to_sym