Skip to content

Commit

Permalink
Fix loaders/dumpers for default types
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewDryga committed Dec 24, 2016
1 parent 2773d72 commit 231cb4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ecto_mnesia/adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defmodule Ecto.Mnesia.Adapter do
Automatically generate next ID for binary keys, leave sequence keys empty for generation on insert.
"""
def autogenerate(:id), do: nil
def autogenerate(:embed_id), do: Ecto.UUID.autogenerate()
def autogenerate(:embed_id), do: Ecto.UUID.generate()
def autogenerate(:binary_id), do: Ecto.UUID.autogenerate()

@doc """
Expand Down Expand Up @@ -261,9 +261,9 @@ defmodule Ecto.Mnesia.Adapter do
# Required methods for Ecto type casing
def loaders({:embed, _value} = primitive, _type), do: [&Ecto.Adapters.SQL.load_embed(primitive, &1)]
def loaders(:binary_id, type), do: [Ecto.UUID, type]
def loaders(primitive, _type), do: [primitive]
def loaders(_primitive, type), do: [type]

def dumpers({:embed, _value} = primitive, _type), do: [&Ecto.Adapters.SQL.dump_embed(primitive, &1)]
def dumpers(:binary_id, type), do: [type, Ecto.UUID]
def dumpers(primitive, _type), do: [primitive]
def dumpers(_primitive, type), do: [type]
end

0 comments on commit 231cb4d

Please sign in to comment.