1
0
Fork 0
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:
Vijay Dev 2011-06-10 17:18:57 +05:30
parent 83289beddd
commit 3c06d25cf9

View file

@ -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