Skip to content

Instantly share code, notes, and snippets.

View mrjbj's full-sized avatar

mrjbj mrjbj

View GitHub Profile
defmodule MyApp.Encoder do
@moduledoc """
General implementation for the Jason encoder to be used in Ecto schemas
"""
defmacro __using__(opts) do
drop_fields = Keyword.get(opts, :drop, [])
quote do
defimpl Jason.Encoder, for: [__MODULE__] do