diff --git a/lib/active_model/serializer/adapter/json_api.rb b/lib/active_model/serializer/adapter/json_api.rb index c1e5c94f1..e50f17cc6 100644 --- a/lib/active_model/serializer/adapter/json_api.rb +++ b/lib/active_model/serializer/adapter/json_api.rb @@ -43,7 +43,7 @@ def serializable_hash(options = nil) def fragment_cache(cached_hash, non_cached_hash) root = false if @options.include?(:include) - ActiveModel::Serializer::Adapter::JsonApi::FragmentCache.new().fragment_cache(root, cached_hash, non_cached_hash) + ActiveModel::Serializer::Adapter::JsonApi::FragmentCache.new.fragment_cache(root, cached_hash, non_cached_hash) end private @@ -56,12 +56,6 @@ def resource_identifier_type_for(serializer) end end - def add_relationships(resource, name, serializers) - resource[:relationships] ||= {} - resource[:relationships][name] ||= { data: [] } - resource[:relationships][name][:data] += serializers.map { |serializer| { type: serializer.json_api_type, id: serializer.id.to_s } } - end - def resource_identifier_id_for(serializer) if serializer.respond_to?(:id) serializer.id