Skip to content

Commit e8a4e43

Browse files
committed
chore: build
1 parent 8ae6683 commit e8a4e43

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

.formatter.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
spark_locals_without_parens = [
22
archive_related: 1,
33
archive_related_arguments: 1,
4+
archive_related_authorize?: 1,
45
attribute: 1,
56
attribute_type: 1,
67
base_filter?: 1,

documentation/dsls/DSL-AshArchival.Resource.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ A section for configuring how archival is configured for a resource.
2727
| [`exclude_upsert_actions`](#archive-exclude_upsert_actions){: #archive-exclude_upsert_actions } | `atom \| list(atom)` | `[]` | This option is deprecated as it no longer has any effect. Upserts are handled according to the upsert identity. See the upserts guide for more. |
2828
| [`exclude_destroy_actions`](#archive-exclude_destroy_actions){: #archive-exclude_destroy_actions } | `atom \| list(atom)` | `[]` | A destroy action or actions that should *not* archive, but instead be left alone. This allows for having a destroy *or* archive pattern. |
2929
| [`archive_related`](#archive-archive_related){: #archive-archive_related } | `list(atom)` | `[]` | A list of relationships that should have all related items archived when this is archived. Notifications are not sent for this operation. |
30+
| [`archive_related_authorize?`](#archive-archive_related_authorize?){: #archive-archive_related_authorize? } | `boolean` | `true` | Whether or not to run authorization checks when reading and archiving related records. |
3031
| [`archive_related_arguments`](#archive-archive_related_arguments){: #archive-archive_related_arguments } | `(any, any -> any) \| module` | | A function to allow passing along some of the arguments to related resources when archiving them. |
3132

3233

lib/ash_archival/resource/resource.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ defmodule AshArchival.Resource do
5151
archive_related_authorize?: [
5252
type: :boolean,
5353
default: true,
54-
doc: "Whether or not to run authorization checks when reading and archiving related records."
54+
doc:
55+
"Whether or not to run authorization checks when reading and archiving related records."
5556
],
5657
archive_related_arguments: [
5758
type:

test/simple_authorize_test.exs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ defmodule SimpleAuthorizeTest do
6767

6868
archive do
6969
archive_related([:posts])
70-
archive_related_authorize?(false) # Disable authorization for related records
70+
# Disable authorization for related records
71+
archive_related_authorize?(false)
7172
end
7273

7374
actions do
@@ -267,6 +268,7 @@ defmodule SimpleAuthorizeTest do
267268
ArgumentError -> :ok
268269
end
269270
end)
271+
270272
:ok
271273
end
272274

@@ -348,7 +350,7 @@ defmodule SimpleAuthorizeTest do
348350

349351
# No posts should remain active
350352
remaining_posts = Ash.read!(PostWithAuth)
351-
assert length(remaining_posts) == 0
353+
assert Enum.empty?(remaining_posts)
352354
end
353355
end
354356

@@ -393,7 +395,7 @@ defmodule SimpleAuthorizeTest do
393395

394396
# No posts should remain active
395397
remaining_posts = Ash.read!(PostNoAuth)
396-
assert length(remaining_posts) == 0
398+
assert Enum.empty?(remaining_posts)
397399
end
398400
end
399401
end

0 commit comments

Comments
 (0)