Created
April 11, 2017 20:23
-
-
Save arjan/fee1d758eef3aaca2456be7de439cc43 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Property do | |
use Ecto.Schema | |
@primary_key false | |
schema "property" do | |
field :id, :integer, primary_key: true | |
belongs_to :model, Model, foreign_key: :model_id | |
end | |
end | |
defmodule Model do | |
use Ecto.Schema | |
@primary_key false | |
schema "model" do | |
field :id, :integer, primary_key: true | |
has_many :properties, Property, foreign_key: :model_id | |
end | |
end | |
# == Compilation error on file lib/tst.ex == | |
# ** (ArgumentError) argument error | |
# lib/ecto/association.ex:474: Ecto.Association.Has.get_ref/3 | |
# lib/ecto/association.ex:424: Ecto.Association.Has.struct/3 | |
# lib/ecto/schema.ex:1679: Ecto.Schema.association/5 | |
# lib/ecto/schema.ex:1474: Ecto.Schema.__has_many__/4 | |
# lib/tst.ex:17: (module) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment