mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
Deprecate option type helper (#352)
This commit is contained in:
parent
e83fcf13fb
commit
bc05fb5b47
2 changed files with 4 additions and 3 deletions
|
@ -143,6 +143,7 @@ defmodule Ash.OptionsHelpers do
|
|||
def map(value) when is_map(value), do: {:ok, value}
|
||||
def map(_), do: {:error, "must be a map"}
|
||||
|
||||
@deprecated "Use {:list, :atom} instead"
|
||||
def list_of_atoms(value) do
|
||||
if is_list(value) and Enum.all?(value, &is_atom/1) do
|
||||
{:ok, value}
|
||||
|
|
|
@ -38,11 +38,11 @@ defmodule Ash.Resource.Actions.SharedOptions do
|
|||
|
||||
@create_update_opts [
|
||||
accept: [
|
||||
type: {:custom, Ash.OptionsHelpers, :list_of_atoms, []},
|
||||
type: {:list, :atom},
|
||||
doc: "The list of attributes to accept. Defaults to all attributes on the resource"
|
||||
],
|
||||
reject: [
|
||||
type: {:custom, Ash.OptionsHelpers, :list_of_atoms, []},
|
||||
type: {:list, :atom},
|
||||
doc: """
|
||||
A list of attributes not to accept. This is useful if you want to say 'accept all but x'
|
||||
|
||||
|
@ -51,7 +51,7 @@ defmodule Ash.Resource.Actions.SharedOptions do
|
|||
"""
|
||||
],
|
||||
require_attributes: [
|
||||
type: {:custom, Ash.OptionsHelpers, :list_of_atoms, []},
|
||||
type: {:list, :atom},
|
||||
doc: """
|
||||
A list of attributes that would normally `allow_nil` to require for this action.
|
||||
|
||||
|
|
Loading…
Reference in a new issue