Is this correct?
def changeset(%MyApp.User{} = struct, params) do
# snip
end
I’m trying to write the changeset function to only accept a struct of type MyApp.User
.
Thanks!
Is this correct?
def changeset(%MyApp.User{} = struct, params) do
# snip
end
I’m trying to write the changeset function to only accept a struct of type MyApp.User
.
Thanks!
Seems to be correct.
Yeah that looks correct. Although sometimes it is also useful to be able to pass a changeset to your changeset functions so that you can compose them. Although that isn’t something that you’ll be doing until you have multiple changeset functions on one schema/model.