Closed msudgh closed 5 years ago
ecto migration tool isn't able to parse defined enum as the following:
ecto
import EctoEnum defenum PatronStatusEnum, "disable", "enabled", "kicked"
Result:
432hz :: w/test/blinder ‹master*› » mix ecto.migrate 1 ↵ Compiling 17 files (.ex) == Compilation error in file lib/ecto_enum.ex == ** (Protocol.UndefinedError) protocol Enumerable not implemented for "enabled" (elixir) lib/enum.ex:1: Enumerable.impl_for!/1 (elixir) lib/enum.ex:141: Enumerable.reduce/3 (elixir) lib/enum.ex:311: Enum.all?/2 lib/ecto_enum.ex:4: (file) (elixir) lib/kernel/parallel_compiler.ex:208: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
what's wrong with defined enum?
Elixir: 1.8.2 phoenix_ecto: 4.0 ecto_sql: 3.0
The code should be:
import EctoEnum defenum PatronStatusEnum, ["disabled", "enabled", "kicked"]
ecto
migration tool isn't able to parse defined enum as the following:Result:
what's wrong with defined enum?
Elixir: 1.8.2 phoenix_ecto: 4.0 ecto_sql: 3.0