1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Updated comment to mention the enum mapping class method [ci skip]

This commit is contained in:
Godfrey Chan 2014-01-14 15:41:44 -08:00
parent ce95fb2991
commit e64a83cdbd

View file

@ -54,11 +54,12 @@ module ActiveRecord
# remove unused values, the explicit +Hash+ syntax should be used.
#
# In rare circumstances you might need to access the mapping directly.
# The mappings are exposed through a constant with the attributes name:
# The mappings are exposed through a class method with the pluralized attribute
# name:
#
# Conversation.statuses # => { "active" => 0, "archived" => 1 }
#
# Use that constant when you need to know the ordinal value of an enum:
# Use that class method when you need to know the ordinal value of an enum:
#
# Conversation.where("status <> ?", Conversation.statuses[:archived])
module Enum