Created
January 20, 2014 20:46
-
-
Save AntelopeSalad/8528791 to your computer and use it in GitHub Desktop.
This file contains 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
includes(*args) public | |
Specify relationships to be included in the result set. For example: | |
users = User.includes(:address) | |
users.each do |user| | |
user.address.city | |
end | |
allows you to access the address attribute of the User model without firing an additional query. This will often result in a performance improvement over a simple join. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment