Created
August 4, 2011 22:42
-
-
Save mneumegen/1126481 to your computer and use it in GitHub Desktop.
Not Friends
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User.joins("LEFT OUTER JOIN friendships ON \ | |
(friendships.user_id = #{current_user.id} AND friendships.friend_id = users.id) OR \ | |
(friendships.user_id = users.id AND friendships.friend_id = #{current_user.id})") | |
.where("friendships.id IS NULL") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment