gjaldon / ecto_enum

Ecto extension to support enums in models
MIT License
562 stars 131 forks source link

Embed enum to current module #75

Closed fuelen closed 5 years ago

fuelen commented 5 years ago

I would really like to use this kind of API to keep namespaces smaller.

defmodule MyApp.Accounts.Status do
  import EctoEnum
  defenum [:active, :pending, :blocked]

  def inactive_group do
    [:pending, :blocked]
  end
end
gjaldon commented 5 years ago

I just added support for use in #77. Does that address your need?

fuelen commented 5 years ago

Yes, many thanks!