ash v1.17.0 Ash.Resource.Dsl.HasMany View Source
Link to this section Summary
Functions
Declares a has_many relationship. There can be any number of related entities.
Link to this section Functions
Declares a has_many relationship. There can be any number of related entities.
Examples
# In a resource called `Word`
has_many :definitions, DictionaryDefinition,
source_field: :text,
destination_field: :word_text
Arguments
:name
- The name of the relationship:destination
- The destination resource
Options
:destination_field
- Required. The field on the related resource that should match thesource_field
on this resource.:source_field
- The field on this resource that should match thedestination_field
on the related resource. The default value is:id
.:writable?
- Whether or not the relationship may be edited. The default value istrue
.:description
- An optional description for the relationship