Use string as keys

上级 5620e62f
......@@ -66,7 +66,7 @@ module Enum
DEFINED_ENUMS = {} # :nodoc:
def enum_mapping_for(attr_name) # :nodoc:
DEFINED_ENUMS[attr_name.to_sym]
DEFINED_ENUMS[attr_name.to_s]
end
def enum(definitions)
......@@ -114,7 +114,7 @@ def enum(definitions)
define_method("#{value}!") { update! name => value }
end
DEFINED_ENUMS[name] = enum_values
DEFINED_ENUMS[name.to_s] = enum_values
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册