Skip to content

Commit

Permalink
Use Cereal.Serializer in the PhoenixView
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbell committed Aug 4, 2017
1 parent 443e02e commit f2a3f99
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/cereal/phoenix_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ defmodule Cereal.PhoenixView do
defmacro __using__(_) do
module = __CALLER__.module
quote do
use Cereal.Serializer

def render("index.json" <> _, data) do
Cereal.PhoenixView.render(unquote(module), data)
end
Expand All @@ -11,7 +13,7 @@ defmodule Cereal.PhoenixView do
end

def render("errors.json" <> _, data) do
Cereal.PhoenixView.render_errors(data)
Cereal.PhoenixView.render_errors(unquote(module), data)
end
end
end
Expand Down

0 comments on commit f2a3f99

Please sign in to comment.