Last active
November 6, 2016 11:58
-
-
Save MartinElvar/48cd8f776659d772976cedad5c90a337 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
defmacro belongs_to(model) do | |
[_ | module] = Module.split(unquote(model)) | |
key = Macro.underscore(module) <> "_id" |> String.to_atom | |
quote do | |
..... | |
> belongs_to(Users.User) | |
== Compilation error on file lib/storages/schemas/storage_schema.ex == | |
** (FunctionClauseError) no function clause matching in Module.split/1 | |
(elixir) lib/module.ex:1006: Module.split({:__aliases__, [line: 13], [:Users, :User]}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment