Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thetechguyseth opened this issue Jun 13, 2024 · 1 comment
Open
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@thetechguyseth
Copy link

thetechguyseth commented Jun 13, 2024

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"}
@thetechguyseth thetechguyseth added the bug Something isn't working label Jun 13, 2024
@zachdaniel
Copy link
Contributor

Given that there are workarounds for this, I'm going to put this in the "soon" category of the roadmap and mark it as a good first issue :)

@zachdaniel zachdaniel added the good first issue Good for newcomers label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Development

No branches or pull requests

2 participants