Closed jaimeiniesta closed 6 years ago
In https://github.com/smpallen99/coherence#customizing-user-changeset it says that we should indicate where the changeset/3 function is located like that:
changeset/3
# config/config.exs config :coherence, # ... changeset: {MyProject.User, :changeset}
In 5.4.0 this works fine for most controllers, but if we go to /passwords/new/ it fails with an argument error.
/passwords/new/
If we change the config to something like:
# config/config.exs config :coherence, # ... changeset: :changeset
it will work fine for /passwords/new but fail for the other controllers.
/passwords/new
I think the problem lies here, as we try to get this config in different, incompatible ways:
https://github.com/smpallen99/coherence/blob/master/lib/coherence/controllers/controller.ex#L289-L293
This problem is on 5.4.0 but it looks like it's still in master.
Is there a way to bypass this problem currently?
This fixes it:
def changeset(:password, module, model, params) do {_mod, fun} = Application.get_env(:coherence, :changeset, :changeset) apply(module, fun, [model, params, :password]) end
In https://github.com/smpallen99/coherence#customizing-user-changeset it says that we should indicate where the
changeset/3
function is located like that:In 5.4.0 this works fine for most controllers, but if we go to
/passwords/new/
it fails with an argument error.If we change the config to something like:
it will work fine for
/passwords/new
but fail for the other controllers.I think the problem lies here, as we try to get this config in different, incompatible ways:
https://github.com/smpallen99/coherence/blob/master/lib/coherence/controllers/controller.ex#L289-L293
This problem is on 5.4.0 but it looks like it's still in master.
Is there a way to bypass this problem currently?