diff options
author | Mike Mangino <mmangino@hubtran.com> | 2017-03-03 15:02:35 -0500 |
---|---|---|
committer | Mike Mangino <mmangino@hubtran.com> | 2017-03-03 15:02:35 -0500 |
commit | 1bb0605dfe09f654d9ad43a86b69183cd6f653f2 (patch) | |
tree | b140192eeb3fadc1628d627f008602c560cc2f04 /activemodel/lib | |
parent | 76be78c59cd75eaafb31719745b43df4743fd33d (diff) | |
download | rails-1bb0605dfe09f654d9ad43a86b69183cd6f653f2.tar.gz rails-1bb0605dfe09f654d9ad43a86b69183cd6f653f2.tar.bz2 rails-1bb0605dfe09f654d9ad43a86b69183cd6f653f2.zip |
Don't accidentally lose includes in serialization
Diffstat (limited to 'activemodel/lib')
-rw-r--r-- | activemodel/lib/active_model/serialization.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/serialization.rb b/activemodel/lib/active_model/serialization.rb index 77834f26fc..78e46c49eb 100644 --- a/activemodel/lib/active_model/serialization.rb +++ b/activemodel/lib/active_model/serialization.rb @@ -177,7 +177,7 @@ module ActiveModel return unless includes = options[:include] unless includes.is_a?(Hash) - includes = Hash[Array(includes).map { |n| n.is_a?(Hash) ? n.to_a.first : [n, {}] }] + includes = Hash[Array(includes).flat_map { |n| n.is_a?(Hash) ? n.to_a : [[n, {}]] }] end includes.each do |association, opts| |