Commit graph

2712 commits

Author SHA1 Message Date
Zach Daniel
6bf4945228 chore: properly match on single pkey and multi pkey in manual relationship matching 2024-07-01 17:25:56 -04:00
kernel-io
3265b36589
fix: compare keys in manual relationships when using 'complex' types (#1270)
Signed-off-by: kernel-io <kernel-io@users.noreply.github.com>
2024-07-01 17:21:01 -04:00
Zach Daniel
90b3f9455a chore: properly wrap notifications list in changeset 2024-07-01 10:19:23 -04:00
Zach Daniel
3e1b15eae4 improvement: remove non-simple equality check for uuidv7 type 2024-07-01 09:38:23 -04:00
Andreas Donig
d436278616
fix: filter parsing cases (#1261)
* Fix the issue with the order of cases

* Make it pass all tests

* Add a test case for the new feature

---------

Co-authored-by: Andreas Donig <git@innwiese.de>
2024-06-30 07:26:25 -04:00
Zach Daniel
659a061b16 fix: ensure notifications are dispatched from bulk actions 2024-06-28 17:10:29 -04:00
Zach Daniel
f5232aa929 chore: do a transaction for after action hooks 2024-06-28 13:40:54 -04:00
Zach Daniel
4c0faabbec Revert "fix: gather up process notifications from atomic transaction"
This reverts commit 62c832a6b3.
2024-06-28 12:53:37 -04:00
Zach Daniel
62c832a6b3 fix: gather up process notifications from atomic transaction 2024-06-28 11:40:44 -04:00
Zach Daniel
2d29dab90b fix: set tenant context when calling data layers
fix: set `from_many?` if a `has_one` has a `sort` applied

(because there is no other reason to apply a `sort`)
2024-06-28 11:13:34 -04:00
Zach Daniel
675e5b3e41 fix: don't set tenant on query unless context multitenancy is set 2024-06-27 21:14:40 -04:00
Zach Daniel
6898bde0a4 fix: proper return value from synthesized joins
fix: properly support multitenancy in joins in ets
2024-06-27 20:53:35 -04:00
Zach Daniel
30d73d5307 fix: ensure that calculation options are expanded 2024-06-26 14:18:27 -04:00
Ryan
a117327c0c
test: assert that notifications are sent for bulk updates and destroys using the :stream strategy (#1266) 2024-06-25 12:39:18 -04:00
Matheus Cardoso
fc0ff54744
docs: Fix typo in Ash.Type constraint (#1264) 2024-06-25 09:21:50 -04:00
Zach Daniel
e4c3f825bb chore: only show values of errors from single known unions 2024-06-24 22:16:15 -04:00
Zach Daniel
c2a57c6e61 chore: don't use error_message on errors when casting single known union 2024-06-24 22:10:26 -04:00
Zach Daniel
14470bfd96 fix: properly return notifications on bulk code interface actions 2024-06-24 21:56:46 -04:00
Zach Daniel
6549fed3dd fix: properly send notifications for transaction: :all 2024-06-24 21:46:10 -04:00
Zach Daniel
dcfd53f22f chore: add back in and improve tmp_ref logic 2024-06-24 21:33:55 -04:00
Zach Daniel
daf4b08ab1 chore: more fixes for ash_started_transaction? 2024-06-24 19:55:38 -04:00
Zach Daniel
1d45802d32 fix: ensure we reset ash_started_transaction process flag 2024-06-24 19:51:20 -04:00
Zach Daniel
fb5e7e7e74 fix: ensure we always set ash_started_transaction? back to false 2024-06-24 19:47:24 -04:00
kernel-io
7ac9d9bdb2
fix: gather notifications in main ref not tmp ref. (#1263)
Signed-off-by: kernel-io <kernel-io@users.noreply.github.com>
2024-06-24 18:51:03 -04:00
Zach Daniel
83434b0d1a improvement: bulk destroy for handling array changes in embeds
improvement: set `__union_tag__` constraint in array handlers for unions
fix: sleep to avoid uuidv7 specifity flaky test
test: remove unused variable in tests
2024-06-24 09:48:08 -04:00
Zach Daniel
ec4ff55529 fix: ensure that we notify on code-interface id synthesized bulk operations 2024-06-24 08:38:45 -04:00
Zach Daniel
60630f23a6 fix: initialize subtypes of unions
fix: properly apply load-through behavior for arrays
2024-06-23 21:12:12 -04:00
Zach Daniel
eb5490fe6f improvement: support offset in the simple data layer
closes #1257
2024-06-23 20:22:21 -04:00
Zach Daniel
ced91af39f chore: avoid trying nil loads 2024-06-23 18:58:39 -04:00
Andreas Donig
23d504e151
Handle relationship filter on primary key (#1254)
Co-authored-by: Andreas Donig <git@innwiese.de>
2024-06-23 18:20:28 -04:00
Alessio Montagnani
7f2e7d3ec1
improvement: bring uuid version 7 into the core (#1253) 2024-06-23 18:16:20 -04:00
Zach Daniel
e17fa8a1c5 chore: get build passing 2024-06-23 17:44:02 -04:00
Zach Daniel
85b928b0d9 chore: remove IO.inspect 🤦🏻 2024-06-23 17:42:46 -04:00
Zach Daniel
9421dbe535 improvement: properly handle after_action hooks in fully atomic changesets 2024-06-23 17:41:11 -04:00
Zach Daniel
78114226a6 improvement: yes, we can in fact do after action hooks atomically 2024-06-23 16:30:10 -04:00
Zach Daniel
abb28cae4a improvement: make after_action change builtin atomic 2024-06-23 16:09:18 -04:00
Zach Daniel
04707aafd7 chore: elixir 1.17 warning 2024-06-21 19:41:08 -04:00
Zach Daniel
5727cc273f improvement: add mix ash.install
improvement: add `mix ash.gen.resource`
improvement: add `mix ash.gen.base_resource`
improvement: add `mix ash.gen.domain`
improvement: add `mix ash.extend`
2024-06-21 19:09:35 -04:00
Zach Daniel
af1fa5eca3 fix: use the proper opts when calling manual updates in bulk updates 2024-06-21 15:01:14 -04:00
Davide Briani
b256e1d8a3
test: Test loading paginated relationship when tenant is in primary key (#1252)
* Chore: test loading paginated relationship when tenant is in primary key

Ash is already able to load paginated relationships on multitenant
resources after a create or update action.
However this change specifically test the case of a many to many
relationship where the tenant is included in the primary key of the
joined resources.

Signed-off-by: Davide Briani <davide@briani.dev>

* fix: apply pagination at runtime for non lateral join queries
fix: consider multitenancy when checking if through-join is unique

---------

Signed-off-by: Davide Briani <davide@briani.dev>
Co-authored-by: Zach Daniel <zach@zachdaniel.dev>
2024-06-21 15:00:50 -04:00
Zach Daniel
2bdc6efde3 fix: don't run any before_action hooks if changeset is invalidated in prior hook 2024-06-21 11:04:26 -04:00
Zach Daniel
cb29738927 chore: fix credo/build 2024-06-20 18:43:51 -04:00
Davide Briani
71d871b54a
Test loading relationships on multitenant resources after create or update (#1249)
* Chore: add tests on loading relationship on multitenant resource

Add tests to verify that relationships can be loaded on multitenant
resources after a create or update action.

Signed-off-by: Davide Briani <davide@briani.dev>

* fix: set tenant in ets data layer when generating aggregates

---------

Signed-off-by: Davide Briani <davide@briani.dev>
Co-authored-by: Zach Daniel <zach@zachdaniel.dev>
2024-06-20 16:46:29 -04:00
Zach Daniel
0eea01d21b chore: consider MapSet as valid for {:array type in matches_type?/2 2024-06-19 19:50:03 -04:00
Zach Daniel
62e06532f1 chore: fix typo in dirty hook checking 2024-06-19 11:29:22 -04:00
Zach Daniel
b32990df3a chore: support after_action hooks in atomic upgrade 2024-06-19 11:27:34 -04:00
Zach Daniel
97df7e714a fix: only prevent atomic upgrade when hooks were explicitly added 2024-06-19 11:23:52 -04:00
Dmitry Maganov
c0f1e2a622
fix: use right argument name in query set_result/clear_result (#1247) 2024-06-19 10:18:27 -04:00
Zach Daniel
2a2f20ade0 improvement: retain error context on overridden messages 2024-06-18 18:20:30 -04:00
Zach Daniel
29032725fb improvement: add optional matches_type?/2 callback to Ash.Type 2024-06-18 16:17:32 -04:00