diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2015-02-13 16:22:20 -0800 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2015-02-13 16:22:20 -0800 |
commit | 91f431972b204ce7c0fc0185ec93118d4d024e9d (patch) | |
tree | 328e460239f6e609f7e8effd09f4105c34a5ff06 /activerecord | |
parent | ae33aea62cd1d3cf489a9335fadc30d1c11e0dc4 (diff) | |
download | rails-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.rb | 5 |
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: |