What would be a good way to get mutual likes ? where 2 users like each other ( as in a friendlist) and get only those users who have a mutual match?
user_id | likes_id
1 2
2 1
Only get results where both of the users likes each other ( friendship )
I have tried some join's but can't really get it to work, is there a building AR feature to get the above results?
To add to jexact's answer this is one way you can do this using AR:
or
An alternative (slower? but imho looks cleaner) way is to do this in your User model (NOT tested, but should give you an idea):