select * from `rental_properties` where `id` in (select `rental_property_id` from `user_favorite_rental_properties` where `user_id` = ?) and `available` = ?
[12345, true]
I'm on a deadline at the moment but will come back later this week to add some tests if you want them and approve this general approach.
Supports queries like this, which can be expressed as joins but are often easier to understand expressed this way--and faster to execute in MySQL:
becomes
I'm on a deadline at the moment but will come back later this week to add some tests if you want them and approve this general approach.