Closed roostercrab closed 4 years ago
It should definitely be login_user
. How did you invoke the generator?
I just looked over my notes and compared it to the instructions, no idea how I ended up switching those, but glad to see it was me!
mix phx.gen.auth Accounts Users user
Looks like it should have been
mix phx.gen.auth Accounts User users
from the docs.
My bad :)
In many places user is pluralized to users such as:
def login_users(conn, users, params \\ %{}) do token = Accounts.generate_users_session_token(users) users_return_to = get_session(conn, :users_return_to)
There doesn't seem to be a singular instance anywhere, is this intended to be the possessive form as in
user's
?I wouldn't normally mind, but I'm trying to attach this to a database field called users and I believe Phoenix is looking for user_id from the users table in some parts to do a one to many association in Ecto and changing it to singular gradually is breaking some things, so I'm wondering if it's the generator that could be modified to make the instances where it's just talking about one user (like logging in) singular?