We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Hey, question, I've the following set of changes running for all actions
changes do ... change set_attribute(:publication_status, :published) do only_when_valid? true where [ negate(attribute_equals(:published_at, nil)), compare(:published_at, greater_than_or_equal_to: &DateTime.utc_now/0 ) ] end ...
When running the primary update action for that resource I get this error
** (Ash.Error.Unknown) Unknown Error * %CaseClauseError{term: [{:atomic, [:published_at], {:_atomic_ref, :published_at} < ~U[2024-05-22 13:56:17.075341Z], error(Ash.Error.Changes.InvalidAttribute, %{message: "must be greater than or equal to %{greater_than_or_equal_to}", value: {:_atomic_ref, :published_at}, vars: %{field: :published_at, greater_than_or_equal_to: ~U[2024-05-22 13:56:17.075346Z]}, field: :published_at})}]} (ash 3.0.2) lib/ash/changeset/changeset.ex:882: anonymous fn/4 in Ash.Changeset.atomic_condition/3 (elixir 1.16.2) lib/enum.ex:4839: Enumerable.List.reduce/3 (elixir 1.16.2) lib/enum.ex:2582: Enum.reduce_while/3 (ash 3.0.2) lib/ash/changeset/changeset.ex:810: Ash.Changeset.run_atomic_change/3 (ash 3.0.2) lib/ash/changeset/changeset.ex:693: anonymous fn/3 in ...
To Reproduce Create a resource like this
defmodule A do use Ash.Resource, domain: As, data_layer: AshPostgres.DataLayer attributes do uuid_primary_key :id, writable?: true, public?: true attribute :publication_status, :atom do public? true allow_nil? false default :draft end attribute :published_at, :utc_datetime_usec, public?: true end changes do #See the change above end end
Then run an update on a resource of type A
A
Expected behavior The change should only be performed if the constraints for it are met
Runtime
The text was updated successfully, but these errors were encountered:
fix: handle list of atomic conditions (ash-project#1194)
5fa34d3
b6dd883
Fixed by #1195
Sorry, something went wrong.
fix: handle list of atomic conditions (#1194) (#1195)
05379e1
No branches or pull requests
Describe the bug
Hey, question, I've the following set of changes running for all actions
When running the primary update action for that resource I get this error
To Reproduce
Create a resource like this
Then run an update on a resource of type
A
Expected behavior
The change should only be performed if the constraints for it are met
Runtime
The text was updated successfully, but these errors were encountered: