diff options
author | Daniel Amireh <daniel@amireh.org> | 2018-07-25 18:03:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-25 18:03:14 +0200 |
commit | 40cfbae94adf67f229a887358740aa65351012dc (patch) | |
tree | 821417bb11fb41dc95fbd5c529960fb63d033a64 /activesupport | |
parent | c02f3578c1e4896de9e6ca56b23a491f2ed677d8 (diff) | |
download | rails-40cfbae94adf67f229a887358740aa65351012dc.tar.gz rails-40cfbae94adf67f229a887358740aa65351012dc.tar.bz2 rails-40cfbae94adf67f229a887358740aa65351012dc.zip |
Update with_options.rb
explicit mapping for enum accepts a Hash not an Array, plus the example is using `.keys` which also exists on hash
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/with_options.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/with_options.rb b/activesupport/lib/active_support/core_ext/object/with_options.rb index 2838fd76be..1d46add6e0 100644 --- a/activesupport/lib/active_support/core_ext/object/with_options.rb +++ b/activesupport/lib/active_support/core_ext/object/with_options.rb @@ -68,7 +68,7 @@ class Object # You can access these methods using the class name instead: # # class Phone < ActiveRecord::Base - # enum phone_number_type: [home: 0, office: 1, mobile: 2] + # enum phone_number_type: { home: 0, office: 1, mobile: 2 } # # with_options presence: true do # validates :phone_number_type, inclusion: { in: Phone.phone_number_types.keys } |