Request to rename the internally used "user" to something else #51

Closed
kotedo opened this Issue Dec 28, 2011 · 5 comments

Projects

None yet

5 participants

@kotedo
kotedo commented Dec 28, 2011

Hi Evan,

People run repeatedly into the issue that they try to use the model "user" and end up in trouble.
It would be nice if ChicagoBoss itself could use a different model name that wold not clash with model names created by ChicagoBoss' users "user" model.

Thank you!
—Kai

Included find the needed stack trace:

=ERROR REPORT==== 27-Dec-2011::21:59:38 ===
Can't load module that resides in sticky dir

=ERROR REPORT==== 27-Dec-2011::21:59:38 ===
** Generic server boss_web terminating
** Last message in was timeout
** When Server state == {state,[],{ok,<0.519.0>},undefined,true}
** Reason for termination ==
** {{badmatch,{error,["code reload failed: user"]}},
[{boss_load,load_all_modules,3},
{boss_web_controller,'-handle_info/2-fun-0-',1},
{lists,map,2},
{boss_web_controller,handle_info,2},
{gen_server,handle_msg,5},
{proc_lib,init_p_do_apply,3}]}

=CRASH REPORT==== 27-Dec-2011::21:59:38 ===
crasher:
initial call: boss_web_controller:init/1
pid: <0.501.0>
registered_name: boss_web
exception exit: {{badmatch,{error,["code reload failed: user"]}},
[{boss_load,load_all_modules,3},
{boss_web_controller,'-handle_info/2-fun-0-',1},
{lists,map,2},
{boss_web_controller,handle_info,2},
{gen_server,handle_msg,5},
{proc_lib,init_p_do_apply,3}]}
in function gen_server:terminate/6
ancestors: [boss_sup,<0.57.0>]
messages: []
links: [<0.511.0>,<0.536.0>,<0.543.0>,<0.539.0>,<0.517.0>,<0.519.0>,
<0.515.0>,<0.503.0>,<0.507.0>,<0.58.0>]
dictionary: [{random_seed,{23116,24313,25941}},
{'exc var counter',10},
{boss_environment,development}]
trap_exit: false
status: running
heap_size: 6765
stack_size: 24
reductions: 68883
neighbours:
neighbour: [{pid,<0.543.0>},
{registered_name,re_cache},
{initial_call,{erlang,apply,2}},
{current_function,{inflector,re_cache_loop,1}},
{ancestors,[]},
{messages,[]},
{links,[<0.501.0>]},
{dictionary,[]},
{trap_exit,false},
{status,waiting},
{heap_size,1597},
{stack_size,4},
{reductions,246}]

@pjay
pjay commented Apr 21, 2012

+1 (just had this issue with my first CB app...)

@Adalan
Adalan commented May 18, 2012

+1 (just hit the same issue)

@rambocoder

There is a user.erl file which is part of Erlang's kernel.
http://www.erlang.org/doc/man/user.html
https://github.com/erlang/otp/blob/master/lib/kernel/src/user.erl

Since Erlang does not have namespaces, kernel's user module is in the global namespace.
In erl shell type: user:module_info().
Name the model: Person or Client.

As an anecdote, when I worked at my university's helpdesk many years ago, our manager did not like us calling support customers as "users".

@kotedo
kotedo commented May 23, 2012

I have accepted the fact that Erlang uses "user" for it's internal sakes. Oh well, Person, Client, Member, Subscriber and many other names make a difference. I recall that all "Users" in a Rails app became pretty boring, pretty quick; thus a fresh breeze of new model names are actually cool with me. :)

@evanmiller
Collaborator

This out of our control -- if you want to reclaim "user" for the people, file an issue with Erlang/OTP.

@evanmiller evanmiller closed this Jan 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment