aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2015-02-13 16:22:20 -0800
committerGodfrey Chan <godfreykfc@gmail.com>2015-02-13 16:22:20 -0800
commit91f431972b204ce7c0fc0185ec93118d4d024e9d (patch)
tree328e460239f6e609f7e8effd09f4105c34a5ff06 /activerecord
parentae33aea62cd1d3cf489a9335fadc30d1c11e0dc4 (diff)
downloadrails-91f431972b204ce7c0fc0185ec93118d4d024e9d.tar.gz
rails-91f431972b204ce7c0fc0185ec93118d4d024e9d.tar.bz2
rails-91f431972b204ce7c0fc0185ec93118d4d024e9d.zip
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.)
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/enum.rb5
1 files changed, 3 insertions, 2 deletions
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: