mirror of https://github.com/rails/rails
Remove Array#wrap usage in AMo serialization
This commit is contained in:
parent
10c3304db6
commit
3d04d726fd
|
@ -1,6 +1,5 @@
|
||||||
require 'active_support/core_ext/hash/except'
|
require 'active_support/core_ext/hash/except'
|
||||||
require 'active_support/core_ext/hash/slice'
|
require 'active_support/core_ext/hash/slice'
|
||||||
require 'active_support/core_ext/array/wrap'
|
|
||||||
|
|
||||||
module ActiveModel
|
module ActiveModel
|
||||||
# == Active Model Serialization
|
# == Active Model Serialization
|
||||||
|
@ -128,7 +127,7 @@ module ActiveModel
|
||||||
return unless include = options[:include]
|
return unless include = options[:include]
|
||||||
|
|
||||||
unless include.is_a?(Hash)
|
unless include.is_a?(Hash)
|
||||||
include = Hash[Array.wrap(include).map { |n| n.is_a?(Hash) ? n.to_a.first : [n, {}] }]
|
include = Hash[Array(include).map { |n| n.is_a?(Hash) ? n.to_a.first : [n, {}] }]
|
||||||
end
|
end
|
||||||
|
|
||||||
include.each do |association, opts|
|
include.each do |association, opts|
|
||||||
|
|
Loading…
Reference in New Issue