提交 02b67577 编写于 作者: Y Yves Senn

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

上级 dcee010c
......@@ -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:
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册