From 91f431972b204ce7c0fc0185ec93118d4d024e9d Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Fri, 13 Feb 2015 16:22:20 -0800 Subject: Enums mapping is a HWIA [ci skip] The previous edit kind of de-emphasized that, so changing it to be more explict. (It also avoids showing it as if it's a string-keyed hash.) --- activerecord/lib/active_record/enum.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/enum.rb b/activerecord/lib/active_record/enum.rb index 5cb80d185b..8eaea6c055 100644 --- a/activerecord/lib/active_record/enum.rb +++ b/activerecord/lib/active_record/enum.rb @@ -65,9 +65,10 @@ module ActiveRecord # # In rare circumstances you might need to access the mapping directly. # The mappings are exposed through a class method with the pluralized attribute - # name: + # name, which return the mapping in a +HashWithIndifferentAccess+: # - # Conversation.statuses # => { "active" => 0, "archived" => 1 } + # Conversation.statuses[:active] # => 0 + # Conversation.statuses["archived"] # => 1 # module Enum def self.extended(base) # :nodoc: -- cgit v1.2.3