diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2014-01-14 03:58:22 -0800 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-01-14 04:00:34 -0800 |
commit | b242b2dbe75f0b5e86e2ce9ef7c2c5ee96e17862 (patch) | |
tree | f561de8b6785ddc09b00f3c8eae116acc82a9e0b /activesupport/lib/active_support/option_merger.rb | |
parent | 028029c1b622f326f254f09e76d2b618f578cd79 (diff) | |
download | rails-b242b2dbe75f0b5e86e2ce9ef7c2c5ee96e17862.tar.gz rails-b242b2dbe75f0b5e86e2ce9ef7c2c5ee96e17862.tar.bz2 rails-b242b2dbe75f0b5e86e2ce9ef7c2c5ee96e17862.zip |
Enum mappings are now exposed via class methods instead of constants.
Example:
class Conversation < ActiveRecord::Base
enum status: [ :active, :archived ]
end
Before:
Conversation::STATUS # => { "active" => 0, "archived" => 1 }
After:
Conversation.statuses # => { "active" => 0, "archived" => 1 }
Diffstat (limited to 'activesupport/lib/active_support/option_merger.rb')
0 files changed, 0 insertions, 0 deletions