Created
November 22, 2018 16:24
-
-
Save alicethewhale/4467e47ac31a8742312a12729cb11caf to your computer and use it in GitHub Desktop.
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
lead_alerts_query = LeadAlert.timeline_subquery(lead) | |
completed_lead_alerts_query = CompletedLeadAlert.timeline_subquery(lead) | |
notes_query = Note.timeline_subquery(lead) | |
transitions_query = LeadTransition.timeline_subquery(lead) | |
union_query = [lead_alerts_query, completed_lead_alerts_query, notes_query, transitions_query].map(&:to_sql).join(" UNION ALL ") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment