Ash.Resource (ash v3.7.6)
View SourceA resource is a static definition of an entity in your system.
Options
:simple_notifiers(list of module that adoptsAsh.Notifier) - Notifiers with no DSL.:validate_domain_inclusion?(boolean/0) - Whether or not to validate that this resource is included in a domain. The default value istrue.:primary_read_warning?(boolean/0) - Set tofalseto silence warnings about arguments, preparations and filters on the primary read action. The default value istrue.:domain(module that adoptsAsh.Domain) - The domain to use when interacting with this resource. Also sets defaults for various options that ask for a domain.:embed_nil_values?(boolean/0) - Whether or not to include keys withnilvalues in an embedded representation. Has no effect unless resource is an embedded resource. The default value istrue.:extensions(list of module that adoptsSpark.Dsl.Extension) - A list of DSL extensions to add to theSpark.Dsl:data_layer(module that adoptsAsh.DataLayer) - data_layer extensions to add to theSpark.DslThe default value isAsh.DataLayer.Simple.:authorizers(one or a list of module that adoptsAsh.Authorizer) - authorizers extensions to add to theSpark.DslThe default value is[].:notifiers(one or a list of module that adoptsAsh.Notifier) - notifiers extensions to add to theSpark.DslThe default value is[].:otp_app(atom/0) - The otp_app to use for any application configurable options:fragments(list ofmodule/0) - Fragments to include in theSpark.Dsl. See the fragments guide for more.
Summary
Functions
Returns true if the load or path to load has been loaded
Returns true if the given field has been selected on a record
Defines create and update timestamp attributes.
Sets a loaded key or path to a key back to its original unloaded stated
Sets a list of loaded key or paths to a key back to their original unloaded stated
Types
Functions
@spec loaded?( nil | [record()] | record() | Ash.Page.page(), atom() | Ash.Query.Calculation.t() | Ash.Query.Aggregate.t() | [atom()], opts :: Keyword.t() ) :: boolean()
Returns true if the load or path to load has been loaded
Options
lists: set to:anyto have this return true if any record in a list that appears has the value loaded. Default is:all.unknown: set totrueto have unknown paths (like nil values or non-resources) return true. Defaults tofalsestrict?: set totrueto return false if a calculation with arguments is being checked
Returns true if the given field has been selected on a record
Options
forbidden_means_selected?: set totrueto returntrueif the field is marked as forbidden
Defines create and update timestamp attributes.
Shorthand for Ash.Resource.Dsl.attributes.create_timestamp and
Ash.Resource.Dsl.attributes.update_timestamp with the attribute names
:inserted_at and :updated_at respectively. Any options passed to this
helper are passed to both timestamp macros.
@spec unload( nil | [record()] | record() | Ash.Page.page(), atom() | [atom()] ) :: nil | [record()] | record() | Ash.Page.page()
Sets a loaded key or path to a key back to its original unloaded stated
@spec unload_many( nil | [record()] | record() | Ash.Page.page(), [atom()] | [[atom()]] ) :: nil | [record()] | record() | Ash.Page.page()
Sets a list of loaded key or paths to a key back to their original unloaded stated