smpallen99 / whatwasit

Track changes to your Ecto models
MIT License
63 stars 8 forks source link

Conflicts with local function #9

Open developerworks opened 8 years ago

developerworks commented 8 years ago

When use whatwasit with phoenix framework, i use mix phoenix.gen.model Post posts title:string body:string generate a model that include a local changeset function which conflicts with <PROJECT_NAME>.Whatwasit.Version model. I can rename my post model changeset function to other name, but every time i created a model, i need to do repeat rename operations.

So, i suggest rename changset function name in <PROJECT_NAME>.Whatwasit.Version model.

Compiling 1 file (.ex)

== Compilation error on file web/models/post.ex ==
** (CompileError) web/models/post.ex:1: imported WhatwasitExample.Whatwasit.Version.changeset/2 conflicts with local function
    (elixir) src/elixir_locals.erl:138: :elixir_locals."-ensure_no_import_conflict/4-lc$^0/1-0-"/3
    (elixir) src/elixir_locals.erl:137: anonymous fn/4 in :elixir_locals.ensure_no_import_conflict/4
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
    (elixir) lib/kernel/parallel_compiler.ex:116: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1
smpallen99 commented 8 years ago

I'll take a look at it. I'm not sure functions need to be renamed. Just need to look at import interactions. I might need to exclude certain functions on an import Version somewhere.

As a work around, you could add import ...Version, except: [changeset: 2] and that should get you working.

Eiji7 commented 8 years ago

If my changes are accepted, then we can close this issue. #17