August 2025
Intermediate to advanced
294 pages
6h 59m
English
Similar to how we generated our Artist resource, we can start by using Ash’s generators to create our basic Album resource. It’s music-related, so it should also be part of the Tunez.Music domain:
| | $ mix ash.gen.resource Tunez.Music.Album --extend postgres |
This will generate the resource file in lib/tunez/music/album.ex, as well as add the new resource to the list of resources in the Tunez.Music domain module.
The next step, just like when we built our first resource, is to consider what kinds of attributes our new resource needs. What information should we record about an Album? Right now, we probably care about these things:
Read now
Unlock full access