August 2025
Intermediate to advanced
294 pages
6h 59m
English
We can model the link between users and their followed artists with a many-to-many[174] relationship—each user can have many followed artists, and each artist can have many ardent followers.
In Ash (and in a lot of other frameworks), this is implemented using a join resource. This join resource will sit in between our two existing resources of Tunez.Music.Artist and Tunez.Accounts.User, joining them together, and have a belongs_to relationship to each of them. Thus, each link between a user and an artist will be a record in the join resource—if ten users each follow ten different artists, then the join table will have 100 records.
The hardest problem in computer ...
Read now
Unlock full access