diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-07-17 11:42:14 -0700 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-07-17 11:42:14 -0700 |
commit | 5245648812733d2c31f251de3e05e78e68bfa3a5 (patch) | |
tree | 6a094dcb22e787c13183bc8d9c23574042b33880 /activerecord/lib/active_record | |
parent | faf6f7851e7766bc64f9d8ed1ade0b5168c5b76f (diff) | |
parent | ef350c9f2e35fc7e16c74158686c9ad2805cb465 (diff) | |
download | rails-5245648812733d2c31f251de3e05e78e68bfa3a5.tar.gz rails-5245648812733d2c31f251de3e05e78e68bfa3a5.tar.bz2 rails-5245648812733d2c31f251de3e05e78e68bfa3a5.zip |
Merge pull request #11479 from henrikhodne/improve-ar-querymethods-includes-docs
Improve ActiveRecord::QueryMethods#includes docs [ci skip]
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index fb585ab8ab..d0c56ac3d0 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -100,6 +100,14 @@ module ActiveRecord # firing an additional query. This will often result in a # performance improvement over a simple +join+. # + # You can also specify multiple relationships, like this: + # + # users = User.includes(:address, :friends) + # + # Loading nested relationships is possible using a Hash: + # + # users = User.includes(:address, friends: [:address, :followers]) + # # === conditions # # If you want to add conditions to your included models you'll have |