Skip to content

Fix error in update when union type has an array in its types #2237

Merged
zachdaniel merged 2 commits intoash-project:mainfrom
Rutgerdj:bugfix/fix-error-in-array-union-type
Jul 30, 2025
Merged

Fix error in update when union type has an array in its types #2237
zachdaniel merged 2 commits intoash-project:mainfrom
Rutgerdj:bugfix/fix-error-in-array-union-type

Conversation

@Rutgerdj
Copy link
Copy Markdown
Contributor

@Rutgerdj Rutgerdj commented Jul 30, 2025

Fixes: #2236

I've added a test that demonstrates the issue.

The fix involves calling the Ash.Type.prepare_change/3 instead of calling the prepare_change function on the type thats in the union.

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

Rutgerdj added 2 commits July 30, 2025 14:56
This test demonstrates the bug described in issue ash-project#2236, where
updates to a property containing a union of an array and another
type were not handled correctly.
@zachdaniel zachdaniel merged commit e71637e into ash-project:main Jul 30, 2025
43 checks passed
@zachdaniel
Copy link
Copy Markdown
Contributor

🚀 Thank you for your contribution! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error updating a union attribute to an array type

2 participants