Phoenix: mix phoenix.gen.model generating wrong module names.

Created on 29 Nov 2016  路  5Comments  路  Source: phoenixframework/phoenix

Environment

  • Elixir version (elixir -v): 1.3.4
  • Phoenix version (mix deps): 1.2.1
  • Operating system: W10

Expected behavior

In a directory named issue_1, mix phoenix.gen.model should generate model modules named Issue1.Modelname, similar to mix phoenix.new.

Actual behavior

The generated modules are instead named like Issue_1.Modelname resulting in a compilation error of module Issue_1.Web is not loaded and could not be found.

Most helpful comment

@klintmane the commit above would also have fixed it for mix phoenix.routes. Thank you @kelvinst for checking and @klintmane for reporting.

All 5 comments

Well, this looks like a real problem. I will open a pull request for it soon.

Sorry, do you have the whole command you are running on the generator?

Well, just looking a little bit for the code, this is already fixed on master. More specifically on this commit. So I guess we can close this, right @chrismccord?

I hope it helps, but I found this is also the case when using mix phoenix.routes.

@klintmane the commit above would also have fixed it for mix phoenix.routes. Thank you @kelvinst for checking and @klintmane for reporting.

Was this page helpful?
0 / 5 - 0 ratings