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:
parent
dcee010ce8
commit
02b6757797
1 changed files with 3 additions and 5 deletions
|
@ -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:
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue