Skip to content

Instantly share code, notes, and snippets.

@drusepth
Created August 2, 2019 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drusepth/5167acf5de4713f56f741b164fbe2928 to your computer and use it in GitHub Desktop.
Save drusepth/5167acf5de4713f56f741b164fbe2928 to your computer and use it in GitHub Desktop.
@linked_entities = @document.document_entities
.where.not(entity_id: nil)
.includes(:entity)
.includes(entity: [:universe, :user, *relations_for_class(-> entity.entity_type)])
.order('entity_type asc')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment