Skip to content

[BUG] Having a key in the kaffy config different from the name of the model causes changeset attrs to be empty #337

@Sgoettschkes

Description

@Sgoettschkes

Versions Used
Kaffy: 0.10.3
Phoenix: 1.7.10
Elixir:

Erlang/OTP 27 [erts-15.2] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

Elixir 1.18.2 (compiled with Erlang/OTP 27)

What's actually happening?

We created a new kaffy resource, and the attrs passed to the changeset where always empty, both on the create and the update.

What should happen instead?

The attrs should be filled with the values passed in the form

Code

def create_resources(_conn) do
    [
      user_management: [
        name: "User Management",
        resources: [
          a_different_name: [
            schema: App.Models.User,
            admin: AppWeb.Kaffy.UserAdmin
          ]
        ]
      ]
  end

Notice the key in the resources list called a_different_name and the schema ending withUser.

As soon as we changed the key to user, it worked.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions