Browse files

Use string as keys

  • Loading branch information...
1 parent 5620e62 commit 55f6c8c908fea2609cbc8503f8d87460fd1b16b4 @rafaelfranca rafaelfranca committed Jan 21, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/enum.rb
View
4 activerecord/lib/active_record/enum.rb
@@ -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

1 comment on commit 55f6c8c

@chancancode
Ruby on Rails member

👍 :shipit:

Please sign in to comment.