I have this relationship in my MySQL database:
Now i want to access the "ismain" attribute from the middle table "productimage", for example:
I can't do the above example because is_main is not part of the "image" table.
I tried doing something like this too:
But it not worked. In short, I want to access the "ismain" attribute when I have a product instance. Can I access the "ismain" attribute and the respective image table using only one database request?
I think I don't need to post my product and image models.