Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
...
scope :between_users, -> (user1_id, user2_id) do
where(sender_id: user1_id, recipient_id: user2_id).or(
where(sender_id: user2_id, recipient_id: user1_id)
)
end
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment