Lesson 9

# Changesets

9
##### lockThis is a paid lesson.
###### Buy the course Discover Elixir & Phoenix

I'm now getting an error message: warning: function Repo.insert/1 is undefined (module Repo is not available).

To fix it, I inserted alias Messengyr.Repo

is this some special case that it's Messengyr.Accounts.User but not Messengyr.Accounts.Accounts - because the module name equals the directory name?

Why "accounts" is as plural name and "user" singular?

Why we change Messengyr.User to Messengyr.Accounts.User but we didn't change Messengyr.Accounts to Messengyr.Accounts.Accounts?

In the Git repository this file is at lib/messengyr/accounts/accounts.ex ... Am I missing something here?

when create the :password as virtual, how does phoenix knows it's referring to the encrypted_password field and not other fields?

@ericchua: It doesn't. By setting it as virtual, we are explicitly telling Phoenix not to map it to a database column.

how come the encrypted_password field is null even I have set the password as 12345678? Having the same issue like this screenshot too.

@ericchua: That's the expected behaviour. We haven't explicitly set the encrypted_password field in our changeset to anything yet. We'll do that in the next chapter. :-)