diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index 057651e0cf297d1003b7a77b5911e8c4e6e846b3..8c9a890a4d905b27d560fff7c6cbfc70045fa41c 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 ], … } ```