Packages

Ecto Fixtures provides a simple DSL for quickly creating fixture data for your test suite.

Current section

Files

Jump to
ecto_fixtures lib ecto fixtures normalizer.ex
Raw

lib/ecto/fixtures/normalizer.ex

defmodule Ecto.Fixtures.Normalizer do
def normalize(data) do
Enum.into data, %{}, fn({type, attributes}) ->
attributes = attributes
|> Map.merge(attributes.rows)
|> Map.delete(:model)
|> Map.delete(:repo)
|> Map.delete(:rows)
{type, attributes}
end
end
end