Skip to content

Manage_relationship calls are not satisfying "allow_nil? false" #168

@thetechguyseth

Description

@thetechguyseth

Describe the bug

Manage_relationship calls are not satisfying allow_nil? false in AshAdmin

image

OR

an issue assigning an argument / attribute to a relationship's "Attribute Defaults" (without assigning a "source_attribute").

OR

both


To Reproduce

Use the attached Livebook (remove the .txt extension)
AshAdminRelationshipIssue.livemd.txt

If I create the changeset by hand everything executes fine. (As seen in the livebook)

Recreate these resources in an ash admin webpage, attempt to add a family_id to a person using the create action.

NOTE: The livebook is running ETS as the data layer but I am using Postgres in the project. ( I can provide the config is needed )


Expected behavior

Adding A family_id when creating a person generates no errors and the 'person' resource is created without issue.

Runtime

  • Elixir version 1.16.2
  • Erlang version OTP 26
  • OS macOS 14.5 (M1 Macbook Pro)
  • Ash version 0.11.0
  • any related extension versions
     {:phoenix, "~> 1.7.12"},
     {:phoenix_ecto, "~> 4.4"},
     {:ecto_sql, "~> 3.10"},
     {:postgrex, ">= 0.0.0"},
     {:phoenix_html, "~> 4.0"},
     {:phoenix_live_reload, "~> 1.2", only: :dev},
     {:phoenix_live_view, "~> 0.20.2"},
     {:floki, ">= 0.30.0", only: :test},
     {:phoenix_live_dashboard, "~> 0.8.3"},
     {:esbuild, "~> 0.8", runtime: Mix.env() == :dev},
     {:tailwind, "~> 0.2", runtime: Mix.env() == :dev},
     {:heroicons,
      github: "tailwindlabs/heroicons",
      tag: "v2.1.1",
      sparse: "optimized",
      app: false,
      compile: false,
      depth: 1},
     {:swoosh, "~> 1.5"},
     {:finch, "~> 0.13"},
     {:telemetry_metrics, "~> 1.0"},
     {:telemetry_poller, "~> 1.0"},
     {:gettext, "~> 0.20"},
     {:jason, "~> 1.2"},
     {:dns_cluster, "~> 0.1.1"},
     {:bandit, "~> 1.2"},
     {:ash, "~> 3.0"},
     {:picosat_elixir, "~> 0.2.3"},
     {:ash_postgres, "~> 2.0"},
     {:ash_phoenix, "~> 2.0"},
     {:ash_admin, "~> 0.11.0"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    Status

    Soon

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions