diff options
author | George Claghorn <george.claghorn@gmail.com> | 2018-06-07 16:03:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-07 16:03:16 -0400 |
commit | 7b33903d7f30027fe99e4632c5517f0c469b3424 (patch) | |
tree | 3bb18cb5180e14caf2e0c00c9edb1b5a7ff17fa1 /guides | |
parent | 35730055174c3b4b4dd2b08fc743e425310d5131 (diff) | |
parent | 1ae1099ed4c47d82b18a2ba8a9028ab06aff1f29 (diff) | |
download | rails-7b33903d7f30027fe99e4632c5517f0c469b3424.tar.gz rails-7b33903d7f30027fe99e4632c5517f0c469b3424.tar.bz2 rails-7b33903d7f30027fe99e4632c5517f0c469b3424.zip |
Merge pull request #33086 from bogdanvlviv/fix-index_with-in-guide
Fix example of `index_with`
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/active_support_core_extensions.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index 057651e0cf..8c9a890a4d 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -2045,10 +2045,10 @@ The method `index_with` generates a hash with the elements of an enumerable as k is either a passed default or returned in a block. ```ruby -%i( title body created_at ).index_with { |attr_name| public_send(attr_name) } +%i( title body created_at ).index_with { |attr_name| post.public_send(attr_name) } # => { title: "hey", body: "what's up?", … } -WEEKDAYS.index_with([ Interval.all_day ]) +WEEKDAYS.index_with(Interval.all_day) # => { monday: [ 0, 1440 ], … } ``` |