module SerializersTestHelpers

  def object_as_json(obj, options = {})
    if obj.is_a?(Array)
      #ActiveModel::Serializer::ArraySerializer.new(obj, serializer: described_class, add_included: true)
      described_class.serialize(obj, options.merge(is_collection: true))
    else
      #serializer = described_class.new(obj)
      described_class.serialize(obj, options)
    end
    #adapter.new(serializer, include: %w[product_orders]).as_json
  end
  def adapter
    #@active_model_adapter = ActiveModel::Serializer.config.adapter
  end
end
