From 58ba61264b45817a39cbb236f4846b7430d3773a Mon Sep 17 00:00:00 2001 From: Michael Guarino Date: Tue, 26 Sep 2017 16:06:48 -0400 Subject: [PATCH] improve include: true --- lib/cereal/builders/entity.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cereal/builders/entity.ex b/lib/cereal/builders/entity.ex index ea240d6..1d3f7d0 100644 --- a/lib/cereal/builders/entity.ex +++ b/lib/cereal/builders/entity.ex @@ -62,10 +62,10 @@ defmodule Cereal.Builders.Entity do # We include the option when the following is true: # 1) The relation options have `include: true` # 2) The `include` option is passed in and includes the resource - defp should_include_relation?(%{include: nil}, _, %{include: true}), do: true + defp should_include_relation?(_, _, %{include: true}), do: true defp should_include_relation?(%{include: included}, name, _) when is_list(included), do: included[name] |> is_list() - defp should_include_relation?(_, _, %{include: include}), do: include + defp should_include_relation?(_, _, %{include: false}), do: false defp should_include_relation?(_, _, _), do: true defp filter_attributes(attrs, %{serializer: serializer, opts: %{fields: fields}} = context) when is_list(fields) do