Resty v0.12.0 Resty.Associations View Source

Resty supports associations between resources. The best way to learn how to use an association is to go check its doc.

Supported associations

Load error

If loading an association results in an error its value will be replaced by the Resty.Associations.LoadError struct. The :error attribute will be loaded with the error that has been returned by the Resty.Repo.find/2 call.

Not loaded

If an association has not been loaded its value will be of the type Resty.Associations.NotLoaded

What may cause an association to not be loaded is that the foreign key of the relation was set to null or that the relation automatic loading has been disabled.

Link to this section Summary

Functions

Load all of the associations of the given resource that should be eager loaded

Load all of the associations of the given resource whether they should be eager loaded or not

Link to this section Functions

Load all of the associations of the given resource that should be eager loaded.

Load all of the associations of the given resource whether they should be eager loaded or not.

This function will not recursively load non eager loaded associations.