Skip to content

Instantly share code, notes, and snippets.

@marisastrong
Created December 8, 2017 19:37
Show Gist options
  • Save marisastrong/31166ed346ce09cadea50533dcb79c0a to your computer and use it in GitHub Desktop.
Save marisastrong/31166ed346ce09cadea50533dcb79c0a to your computer and use it in GitHub Desktop.
This is where we put some information on the code snippet what it does and why it is useful to use
/* this is my gist. can be code if i want. */
ids = []
Template.find_by_sql(id_query).each do |templ|
ids << templ.id
end
Template.includes(:org).where(id: ids).order('orgs.name, templates.title')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment