From 43e09c03defb0f164c7cc0a6f9e6cbbe902dedcc Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Tue, 11 Aug 2015 17:08:09 -0500 Subject: [PATCH] Fix incorrect s/options = {}/options ||= {} Introduced in #965, surfaced in #1041 --- lib/active_model/serializer/adapter/json_api.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_model/serializer/adapter/json_api.rb b/lib/active_model/serializer/adapter/json_api.rb index 551ed54b1..ee17ef942 100644 --- a/lib/active_model/serializer/adapter/json_api.rb +++ b/lib/active_model/serializer/adapter/json_api.rb @@ -16,7 +16,7 @@ def initialize(serializer, options = {}) end def serializable_hash(options = nil) - options = {} + options ||= {} if serializer.respond_to?(:each) serializer.each do |s| result = self.class.new(s, @options.merge(fieldset: @fieldset)).serializable_hash(options)