lib/intercom/collection_proxy.rb in intercom-2.2.0 vs lib/intercom/collection_proxy.rb in intercom-2.2.1

- old
+ new

@@ -45,10 +45,14 @@ def resource_class; @resource_class; end def deserialize_response_hash(response_hash, block) top_level_type = response_hash.delete('type') - top_level_entity_key = Utils.entity_key_from_type(top_level_type) + if resource_name == 'subscriptions' + top_level_entity_key = 'items' + else + top_level_entity_key = Utils.entity_key_from_type(top_level_type) + end response_hash[top_level_entity_key].each do |object_json| block.call Lib::TypedJsonDeserializer.new(object_json).deserialize end end