I have two models Users and Friendships in my RoR application
The friendships table contains two integer fields user1 and user2, both these fields represent a relationship.
How would I go about selecting all friends for a given user id that exists in either the user1 or user2 field?
Thanks.
You can use
find_by_sqlhttp://apidock.com/rails/ActiveRecord/Base/find_by_sql/class