mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
favor includes over old AR way
This commit is contained in:
parent
83289beddd
commit
3c06d25cf9
1 changed files with 1 additions and 1 deletions
|
@ -66,7 +66,7 @@ resources :posts
|
|||
# home_controller.rb
|
||||
class HomeController < ApplicationController
|
||||
def dashboard
|
||||
@users = User.last_ten(:include => :avatars)
|
||||
@users = User.last_ten.includes(:avatars)
|
||||
@posts = Post.all_today
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue