diff --git a/activesupport/lib/active_support/core_ext/enumerable.rb b/activesupport/lib/active_support/core_ext/enumerable.rb index 6ba68ababa..97c918a71f 100644 --- a/activesupport/lib/active_support/core_ext/enumerable.rb +++ b/activesupport/lib/active_support/core_ext/enumerable.rb @@ -153,7 +153,8 @@ module Enumerable if keys.many? map { |element| keys.map { |key| element[key] } } else - map { |element| element[keys.first] } + key = keys.first + map { |element| element[key] } end end