Skip to content

Commit

Permalink
fix: don't rewrite all attributes to atomics
Browse files Browse the repository at this point in the history
fixes #1541
  • Loading branch information
zachdaniel committed Oct 22, 2024
1 parent ff418c2 commit 15a5150
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ash-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ jobs:
igniter-upgrade:
name: mix igniter.upgrade
runs-on: ubuntu-latest
if: ${{inputs.igniter-upgrade}}
steps:
- name: Dependabot metadata
id: dependabot-metadata
Expand All @@ -186,9 +187,7 @@ jobs:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v3
- uses: team-alembic/staple-actions/actions/mix-task@main
if: ${{inputs.postgres && inputs.ash_postgres}}
with:
mix-env: test
task: igniter.upgrade --git-ci
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v5
Expand Down
5 changes: 0 additions & 5 deletions lib/ash/actions/update/bulk.ex
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,6 @@ defmodule Ash.Actions.Update.Bulk do
add_changeset_filters(query, atomic_changeset),
%Ash.Changeset{valid?: true} = atomic_changeset <-
Ash.Changeset.handle_allow_nil_atomics(atomic_changeset, opts[:actor]),
atomic_changeset <- %{
atomic_changeset
| atomics:
Keyword.merge(Keyword.new(atomic_changeset.attributes), atomic_changeset.atomics)
},
atomic_changeset <- sort_atomic_changes(atomic_changeset),
query <- handle_attribute_multitenancy(query),
{:ok, data_layer_query} <-
Expand Down
8 changes: 3 additions & 5 deletions lib/ash/changeset/changeset.ex
Original file line number Diff line number Diff line change
Expand Up @@ -655,16 +655,14 @@ defmodule Ash.Changeset do
%Ash.Changeset{} = changeset <- set_argument_defaults(changeset, action),
%Ash.Changeset{} = changeset <- require_arguments(changeset, action),
%Ash.Changeset{} = changeset <- atomic_changes(changeset, action),
# %Ash.Changeset{} = changeset <- attributes_as_atomics(changeset),
# _ <- IO.inspect(changeset.atomics),
%Ash.Changeset{} = changeset <- atomic_defaults(changeset),
%Ash.Changeset{} = changeset <- atomic_update(changeset, opts[:atomic_update] || []),
%Ash.Changeset{} = changeset <-
hydrate_atomic_refs(changeset, opts[:actor], Keyword.take(opts, [:eager?])),
%Ash.Changeset{} = changeset <- apply_atomic_constraints(changeset, opts[:actor]) do
%{
changeset
| atomics: Keyword.merge(Map.to_list(changeset.attributes), changeset.atomics),
attributes: %{}
}
changeset
else
{:not_atomic, reason} ->
{:not_atomic, reason}
Expand Down

0 comments on commit 15a5150

Please sign in to comment.