Skip to content

Commit

Permalink
BIT(1) type cannot load as type :boolean #1366 (#1368)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgithub authored and josevalim committed Apr 13, 2016
1 parent f30f3e7 commit c1c8e38
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 c1c8e38

Please sign in to comment.