I have an application I am making which will have albums and upload functions.
On a user's album page, I would like to display the latest image stored in the uploads table that was inserted into an album as the cover.
For example, an Album has an id of 1. The uploads table has a column called album_id, where the default value is NULL. There are 10 records in the uploads table, but only 4 have the number 1 in the album_id column. The latest upload record will be pulled with the Album model via a relationship.
How can I go about this? My guess is it has something to do with Polymorphic Relations?