Last active
January 13, 2018 12:34
-
-
Save ono/92f5fe4e976b6f623749357f228384de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyApp.Category do | |
use Ecto.Schema | |
alias MyApp.Category | |
schema "categories" do | |
field :name, :string | |
field :description, :string | |
field :display_order, :integer | |
embeds_many :children, Child, [on_replace: :delete] do | |
belongs_to :category, Category | |
end | |
timestamps() | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment