Skip to content

Commit

Permalink
BIT(1) type cannot load as type :boolean elixir-ecto#1366
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgithub committed Apr 13, 2016
1 parent f30f3e7 commit 60f191a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/ecto/adapters/mysql.ex
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ defmodule Ecto.Adapters.MySQL do
do: super(type, json_library.decode!(binary))
def load(:map, binary) when is_binary(binary),
do: super(:map, json_library.decode!(binary))
def load(:boolean, <<0>>), do: {:ok, false}
def load(:boolean, <<1>>), do: {:ok, true}
def load(:boolean, 0), do: {:ok, false}
def load(:boolean, 1), do: {:ok, true}
def load(type, value), do: super(type, value)
Expand Down

0 comments on commit 60f191a

Please sign in to comment.