diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2014-05-09 13:49:20 -0700 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-05-09 13:49:20 -0700 |
commit | 074c8ef38e333db1e97ac6b0136e76854fc28632 (patch) | |
tree | b22c3979302e60b650ca6f919f0707359505d74c /activerecord | |
parent | f4511690994f0c14c60320bbeecc66549332dbee (diff) | |
parent | 21b0c2e8a7119fd667e02f4207f0eaa3bd33d3bc (diff) | |
download | rails-074c8ef38e333db1e97ac6b0136e76854fc28632.tar.gz rails-074c8ef38e333db1e97ac6b0136e76854fc28632.tar.bz2 rails-074c8ef38e333db1e97ac6b0136e76854fc28632.zip |
Merge pull request #15045 from xanhast/patch-1
Documentation, add examples of using an Enum scope [ci skip]
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/enum.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/enum.rb b/activerecord/lib/active_record/enum.rb index 18f1ca26de..c7ec093824 100644 --- a/activerecord/lib/active_record/enum.rb +++ b/activerecord/lib/active_record/enum.rb @@ -27,8 +27,10 @@ module ActiveRecord # conversation.status # => nil # # Scopes based on the allowed values of the enum field will be provided - # as well. With the above example, it will create an +active+ and +archived+ - # scope. + # as well. With the above example: + # + # Conversation.active + # Conversation.archived # # You can set the default value from the database declaration, like: # |