ash v1.13.0 Ash.Resource.Dsl.Calculate View Source
Link to this section Summary
Functions
Declares a named calculation on the resource.
Link to this section Functions
Declares a named calculation on the resource.
Takes a module that must adopt the Ash.Calculation
behaviour. See that module
for more information.
Examples
calculate :full_name, MyApp.MyResource.FullName
calculate :full_name, {MyApp.FullName, keys: [:first_name, :last_name]}
calculate :full_name, full_name([:first_name, :last_name])
Arguments
:name
- The field name to use for the calculation value:calculation
- The module or {module, opts} to use for the calculation