ash v1.6.2 Ash.Resource.Dsl.UpdateTimestamp View Source
Link to this section Summary
Functions
Declares a non-writable attribute with a create and update default of &DateTime.utc_now/0
Link to this section Functions
Declares a non-writable attribute with a create and update default of &DateTime.utc_now/0
Examples
update_timestamp :inserted_at
Arguments
:name
- The name of the attribute.
Options
:type
- The type of the attribute. The default value is:utc_datetime
.:constraints
- Constraints to provide to the type when casting the value. See the type's documentation for more information.:primary_key?
- Whether or not the attribute is part of the primary key (one or more fields that uniquely identify a resource) The default value isfalse
.:allow_nil?
- Whether or not the attribute can be set to nil The default value istrue
.:generated?
- Whether or not the value may be generated by the data layer. If it is, the data layer will know to read the value back after writing. The default value isfalse
.:writable?
- Whether or not the value can be written to The default value isfalse
.:update_default
- A zero argument function, an {mod, fun, args} triple or{:constant, value}
. If no value is provided for the attribute on update, this value is used. The default value is&DateTime.utc_now/0
.:default
- A zero argument function, an {mod, fun, args} triple or{:constant, value}
. If no value is provided for the attribute on create, this value is used. The default value is&DateTime.utc_now/0
.:description
- An optional description for the attribute