So following this tutorial:
https://github.com/evanmiller/ChicagoBoss/wiki/An-Evening-With-Chicago-Boss
Everything works like a charm except that I can not use "user" as a modelname. A minimum usecase:
-module(customer, [Id, Name, PasswordHash]).
-compile(export_all).
This will work fine.
-module(user, [Id, Name, PasswordHash]).
-compile(export_all).
this will stacktrace, and on ./rebar compile
, it throws:
ERROR: pre_compile failed while processing /Users/abe/github/awesome-name: {'EXIT',{{badmatch,{error,["code reload failed: user"]}},
[{boss_load,load_all_modules,3,
[{file,"src/boss/boss_load.erl"},{line,30}]},
{boss_load,load_all_modules_and_emit_app_file,2,
[{file,"src/boss/boss_load.erl"},{line,44}]},
{boss_rebar,compile,4,
[{file,"/Users/abe/github/ChicagoBoss/priv/rebar/boss_rebar.erl"},
{line,85}]},
{boss_plugin,pre_compile,2,
[{file,"priv/rebar/boss_plugin.erl"},{line,105}]},
{rebar_core,run_modules,4,[]},
{rebar_core,execute,5,[]},
{rebar_core,process_dir1,6,[]},
{rebar_core,process_commands,2,[]}]}}
this occurs with both {db_adapter, mock}
and {db_adapter, mongo}
.
Anybody know what's going on? Is the user keyword reserved somewhere? I can't find it in the documentation if it is...
Erlang has a flat module namespace. There is a module named user in the kernel application.