diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-11-06 10:49:22 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-11-06 10:49:22 +0100 |
commit | 02b67577973c628e8176bf2586fff8f7a487d6bf (patch) | |
tree | 0fe1496be0e3948de7d0ee9b6fc6d83662fd9654 | |
parent | dcee010ce8c05cd0180e691ca165d774fba60de7 (diff) | |
download | rails-02b67577973c628e8176bf2586fff8f7a487d6bf.tar.gz rails-02b67577973c628e8176bf2586fff8f7a487d6bf.tar.bz2 rails-02b67577973c628e8176bf2586fff8f7a487d6bf.zip |
update the AR enum docs to match the actual behavior. [ci skip]
-rw-r--r-- | activerecord/lib/active_record/enum.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/enum.rb b/activerecord/lib/active_record/enum.rb index a70638f3df..9263dc1e6b 100644 --- a/activerecord/lib/active_record/enum.rb +++ b/activerecord/lib/active_record/enum.rb @@ -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: # |