mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 14:56:50 +00:00
Passing options[:hash] is not public API of include!
This commit is contained in:
parent
ea3566955c
commit
a41de0286f
@ -352,23 +352,8 @@ module ActiveModel
|
|||||||
end
|
end
|
||||||
|
|
||||||
def include!(name, options={})
|
def include!(name, options={})
|
||||||
# Make sure that if a special options[:hash] was passed in, we generate
|
hash = @options[:hash]
|
||||||
# a new unique values hash and don't clobber the original. If the hash
|
unique_values = @options[:unique_values] ||= {}
|
||||||
# passed in is the same as the current options hash, use the current
|
|
||||||
# unique values.
|
|
||||||
#
|
|
||||||
# TODO: Should passing in a Hash even be public API here?
|
|
||||||
unique_values =
|
|
||||||
if hash = options[:hash]
|
|
||||||
if @options[:hash] == hash
|
|
||||||
@options[:unique_values] ||= {}
|
|
||||||
else
|
|
||||||
{}
|
|
||||||
end
|
|
||||||
else
|
|
||||||
hash = @options[:hash]
|
|
||||||
@options[:unique_values] ||= {}
|
|
||||||
end
|
|
||||||
|
|
||||||
node = options[:node] ||= @node
|
node = options[:node] ||= @node
|
||||||
value = options[:value]
|
value = options[:value]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user