From a41de0286ff0890596fe0e8d37912db96edd9453 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Mon, 13 May 2013 17:37:36 -0700 Subject: [PATCH] Passing options[:hash] is not public API of include! --- lib/active_model/serializer.rb | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/lib/active_model/serializer.rb b/lib/active_model/serializer.rb index 1e9787ba..c1cd4990 100644 --- a/lib/active_model/serializer.rb +++ b/lib/active_model/serializer.rb @@ -352,23 +352,8 @@ module ActiveModel end def include!(name, options={}) - # Make sure that if a special options[:hash] was passed in, we generate - # a new unique values hash and don't clobber the original. If the hash - # 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 + hash = @options[:hash] + unique_values = @options[:unique_values] ||= {} node = options[:node] ||= @node value = options[:value]