Created
January 11, 2017 09:58
-
-
Save pareeohnos/1d49737ac7dbaecbdf63e02648529b0f 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 Models.MyModel do | |
schema "models" do | |
... | |
belongs_to :assoc, Models.Assoc, type: :string, foreign_key: :assoc | |
end | |
end | |
== Compilation error on file lib/core/models/my_model.ex == | |
** (ArgumentError) foreign_key :assoc must be distinct from corresponding association name | |
lib/ecto/schema.ex:1183: Ecto.Schema.__belongs_to__/4 | |
lib/core/models/my_model.ex:24: (module) | |
(stdlib) erl_eval.erl:670: :erl_eval.do_apply/6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment