Created
November 12, 2017 14:26
-
-
Save domagude/992316c76fb69c5606b9793c1663135f to your computer and use it in GitHub Desktop.
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
... | |
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