Skip to content

Instantly share code, notes, and snippets.

@flaugabriel
Created December 27, 2018 12:57
Show Gist options
  • Save flaugabriel/a682e35ccc0ea23f57e5a3cd5ab4272d to your computer and use it in GitHub Desktop.
Save flaugabriel/a682e35ccc0ea23f57e5a3cd5ab4272d to your computer and use it in GitHub Desktop.
If we go through Rails documenting, it clearly says — ‘With includes,
Active Record ensures that all of the specified associations are
loaded using the minimum possible number of queries’.
When we need data to be used from associated tables, includes must be used.
-------------------------------
Se passarmos pela documentação do Rails, ele diz claramente:
"Com includes, o Active Record garante que todas as associações
especificadas sejam carregadas usando o número mínimo possível de consultas".
Quando precisamos que os dados sejam usados nas tabelas associadas,
os includes devem ser usados.
--------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment