Last active
August 14, 2020 17:35
-
-
Save walshyb/e42ed7a48e3755d9bfd29cdba26d1a1f to your computer and use it in GitHub Desktop.
Updated where clause that includes primary
This file contains hidden or 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
where(conditions.to_h) | |
.includes(:email_addresses) | |
.where(email_addresses: { | |
email: email, | |
primary: true | |
}).first |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment