Commit graph

558 commits

Author SHA1 Message Date
Zach Daniel
c7e6133317 improvement: support embed_nil_values? for trimming down stored embeds 2023-12-06 10:29:39 -05:00
Robert Graff
636f99fb2d
test: Add test for updating embedded union values (#796) 2023-12-06 10:16:19 -05:00
Jechol Lee
7b70c3a58e
test: Fix ParentTest (#793) 2023-12-05 01:36:40 -05:00
Jechol Lee
86e171a0c1
test: various test improvements (#795) 2023-12-05 01:34:21 -05:00
Jechol Lee
728226bfee
test: Fix typo in MultitenancyTest (#789) 2023-12-01 13:02:06 -05:00
Darren Black
7106c61545
test: Failing test for Api.get (#786) 2023-11-29 20:05:36 -05:00
Zach Daniel
be935723d2 fix: properly resolve nested calculation dependencies 2023-11-24 07:23:38 -05:00
Jeremy Grant
1ce05562aa
fix: change_attribute failing on a union attribute (#778) 2023-11-20 19:10:35 -05:00
Zach Daniel
b9f804db10 fix: properly set actor context on calc expressions in ets data layer 2023-11-16 08:18:39 -05:00
Daniel Newman
8103831cf6 Bug: Actor not being passed 2023-11-15 17:05:31 -05:00
Simon Bergström
b0d5c08f5d
fix: properly include relationship name message when relationship cannot be found (#770) 2023-11-13 17:04:35 -05:00
Barnabas Jovanovics
abb0854ae9
fix: remove destroyed or unrelated data from the relationship (#767) 2023-11-13 13:58:09 -05:00
Eduardo B. A
1775ab5a14
feat: Expand upsert_fields option (#761)
With this change, upsert_fields accepts the following options:

* `nil`: upsert fields not set;
* `:replace_all`: all fields from resource will be updated;
* `{:replace_all_except, [fields]}`: all fields from resource except fields inside `fields` will be updated;
* `{:replace, [fields]}`: only fields inside `fields` will be updated.
2023-11-13 13:23:16 -05:00
Zach Daniel
7b50a401d8 fix: optimize and make Ash.Type more consistent 2023-10-26 22:04:57 -04:00
Robert Graff
a48d43e79d
fix more handle change use cases (#757) 2023-10-25 17:47:50 -04:00
Zach Daniel
539f5a1727 fix: remove invalid usages of unsafe_change_attribute/3
ci: test against `ash_paper_trail`
2023-10-25 13:06:04 -04:00
Robert Graff
0e538470a2
test: regression test for Ash.Changeset.changing_attribute?/2 (#755) 2023-10-25 12:56:45 -04:00
Robert Graff
f03b6a4370
fix: handle builtin types in unions (#752) 2023-10-25 08:31:25 -04:00
Frédérick Capovilla
76783b355b
feat: Add unknown argument error when passing an unknown key to an action. (#750)
* improvement: Add ash_three? feature flag for Ash 3.0 related behaviors.

* test: Add the ash_three test tag to exclude tests targetting Ash 3.0
2023-10-24 12:27:33 -04:00
Zach Daniel
7eac076581 chore: update dialyzer & cleanup dead code 2023-10-21 23:30:33 -04:00
Zach Daniel
63dbf2603f chore: format 2023-10-21 23:20:13 -04:00
Zach Daniel
9ad876af20 improvement: add Ash.Test.assert_has_error and Ash.Test.refute_has_error 2023-10-21 23:14:45 -04:00
Zach Daniel
dec32f47ee improvement: support to_error_class taking changeset/query/input 2023-10-21 22:55:45 -04:00
Frédérick Capovilla
60d12f86da
fix: Change heading levels in generated livebook to have only one H1 (#747) 2023-10-21 22:32:46 -04:00
Jordan Hewitt
003d5eb0e3
fix: code gen interfaces check type first argument (#749)
* reproduced reported error message.

* remove path matching from code interface in order to make error error from issue 679 more clear.

---------

Co-authored-by: Jordan <srcrr-gitlab@ipriva.com>
2023-10-21 19:52:37 -04:00
Zach Daniel
2dbebf39e1 fix: properly determine resource from Ash.get!/2 2023-10-20 06:22:32 -04:00
Zach Daniel
1ab5a35d7f
improvement: support an api option to use Ash.Resource (#715)
* improvement: support an `api` option to `use Ash.Resource`
improvement: add functions to `Ash` for resources w/ configured apis
improvement: default code_interface.define_for to resource's ash api
2023-10-20 06:07:34 -04:00
Zach Daniel
ff88ce68b4
improvement: rewrite bulk creates, optimize changeset functions (#744) 2023-10-18 14:07:44 -04:00
Zach Daniel
d9bacc1554 fix: handle new type constraints properly 2023-10-17 12:50:14 -04:00
Pierre Le Gall
e14e1b2e29
improvement: set default many to many options (#737)
Many to many relationship `source_attribute_on_join_resource`
and `destination_attribute_on_join_resource` are now guessed
by there module name if not explicitly set in the relationship.
2023-10-17 10:03:21 -04:00
Zach Daniel
52337b7bff improvement: various optimizations for bulk create actions 2023-10-16 23:50:05 -04:00
Zach Daniel
f53626e65d improvement: support max_concurrency option on bulk creates
improvement: better error message on missing identities
improvement: better error message on invalid data passed to `YourApi.load`
2023-10-16 14:53:27 -04:00
Zach Daniel
6e0be43c51 fix: properly authorize access to query aggregates in all cases 2023-10-11 19:44:50 -04:00
Zach Daniel
1ab4b6e69a improvement: support atomics on upserts 2023-10-11 15:09:06 -04:00
Zach Daniel
3782f1cfe2 fix: honor authorize? option for calls to aggregate 2023-10-10 11:10:58 -04:00
Zach Daniel
fbe6b21bf0 improvement: support to-one reference paths in calculations 2023-10-09 18:50:15 -04:00
Zach Daniel
06d152c415 chore: remove IO.inspect 2023-10-07 17:08:12 -04:00
Zach Daniel
32620dfd52 improvement: add Ash.Sort.expr_sort. In 3.0 sort should be a macro 2023-10-07 09:16:52 -04:00
Zach Daniel
04c9249f24 fix: properly perform field authorization on loaded through types 2023-09-28 10:23:16 -04:00
Barnabas Jovanovics
4fb6da6eee
test: update test to load forbidden field through union (#713) 2023-09-28 08:36:37 -04:00
Zach Daniel
a00806eeb0 fix: static checks with conditions could be overly or insufficiently restrictive 2023-09-27 14:40:40 -04:00
Barnabas Jovanovics
a1ad5d5476
add test showing the problem with expressions in field_policy conditions (#710) 2023-09-27 18:58:25 +02:00
Barnabas Jovanovics
9e16109950
feat: expose query or changeset to field policies (#701) 2023-09-25 11:13:36 -04:00
Zach Daniel
93fc4a35b2 improvement: rework utc_datetime to datetime
the old types are now newtypes over the new type

fixes: #704
2023-09-25 11:11:56 -04:00
Zach Daniel
2d9f9ee362 improvement: deprecate old school manual actions
note: these have been deprecated for a very long time, removing them will not
be considered a breaking change (and there will be clear compile errors)
2023-09-25 09:40:29 -04:00
Zach Daniel
b7b2f586a1 chore: format test 2023-09-22 17:05:07 -04:00
Zach Daniel
b13c7f0e53 improvement: add Ash.Query.around_transaction/2 2023-09-22 16:46:43 -04:00
Zach Daniel
1d43b26127 chore: move validate_relationship_attributes to a verifier 2023-09-20 16:51:38 -04:00
Zach Daniel
b0bd2d23d9 improvement: support map_with_tag storage mode for Ash.Union.
closes #694
2023-09-18 10:13:22 -04:00
Zach Daniel
9102966d05 test: update tests to account for no authorizers == authorized 2023-09-18 10:09:27 -04:00