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

update the AR enum docs to match the actual behavior. [ci skip]

This commit is contained in:
Yves Senn 2013-11-06 10:49:22 +01:00
parent dcee010ce8
commit 02b6757797

View file

@ -5,20 +5,18 @@ module ActiveRecord
# enum status: [ :active, :archived ]
# end
#
# Conversation::STATUS # => { active: 0, archived: 1 }
#
# # conversation.update! status: 0
# conversation.active!
# conversation.active? # => true
# conversation.status # => :active
# conversation.status # => "active"
#
# # conversation.update! status: 1
# conversation.archived!
# conversation.archived? # => true
# conversation.status # => :archived
# conversation.status # => "archived"
#
# # conversation.update! status: 1
# conversation.status = :archived
# conversation.status = "archived"
#
# You can set the default value from the database declaration, like:
#