Commit graph

575 commits

Author SHA1 Message Date
Rohan Relan
750dc17286
test: Adds a test to ensure authorization occurs when the actor is set and authorization? is by_default (#813)
Co-authored-by: Rohan Relan <roresemail@gmail.com>
2023-12-27 10:27:22 -05:00
Zach Daniel
eb05e9be63 improvement: support streaming without keyset pagination
use the new `allow_stream_with` and `stream_with` options to control
what strategy may be used to stream query results.
2023-12-21 08:35:49 -05:00
Zach Daniel
ed887413d7 improvement: base case iterative bulk destroy implemented 2023-12-20 21:08:40 -05:00
Zach Daniel
8c17434803 improvement: add iterative, streaming implementation for bulk updates 2023-12-20 17:33:43 -05:00
Zach Daniel
2233a33523 improvement: support tenancy on manual actions
docs: update cheat shets
fix: honor tenant option on aggregates

closes #805
2023-12-16 10:33:10 -05:00
Zach Daniel
3be83d6ca4 improvement: lay the groundwork for fully atomic actions 2023-12-16 10:14:02 -05:00
Zach Daniel
52a62c7c45 chore: fix tests 2023-12-15 15:45:23 -05:00
Zach Daniel
e22c6c7927 fix: ensure actions always raise an error class 2023-12-15 15:33:10 -05:00
Zach Daniel
ad22eeb7e9 improvement: rewrite creates to not use Ash.Engine 2023-12-15 15:10:01 -05:00
Thales Grilo
9d2da58fb2
improvement: Adds %Ash.NotSelected{} to ash 3 (!634) (#804)
*  create Ash.NotSelected, add test

*  add ash_three test

* 👌 fix formatting

* 👌 add missing field value

---------

Co-authored-by: thales <thales@uplearn.co.uk>
2023-12-14 16:14:15 -05:00
Robert Graff
014621cc09
test: reproduce bug casting embedded union arguments (#803) 2023-12-14 09:04:56 -05:00
Zach Daniel
d09c694132 fix: thread context through when setting source constraint on embeds 2023-12-13 17:11:52 -05:00
Robert Graff
e13bb6e0b4
test: Failing test for threading source information through embedded attributes (#801) 2023-12-13 16:47:11 -05:00
Zach Daniel
7298a4b51b improvement: honor field policies in sort expressions 2023-12-13 15:08:39 -05:00
Zach Daniel
5c0275a78b test: add test for simple data layer pagination 2023-12-11 19:58:14 -05:00
Zach Daniel
c38cba51b0 fix: test failures and credo issue 2023-12-10 13:13:06 -05:00
Jechol Lee
30deb8c32e
test: Remove unnecessary 'authorize?: false' and explicitly specify the filter policy results. (#798) 2023-12-07 20:22:46 -05:00
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