ryanb / railscasts

railscasts.com in open source (outdated).
http://railscasts.com
MIT License
760 stars 175 forks source link

Explicitly include episode to avoid hitting ActiveRecord's cache so much #49

Closed goncalossilva closed 3 years ago

goncalossilva commented 12 years ago

Since @episode is loaded by cancan you can't eager load its comments up-front. You do this in the partial, but for some reason whenever you're accessing comment.episode it's hitting ActiveRecord's cache. This fixes it.

dustMason commented 12 years ago

+1 Goncalo! I was in the audience today when you submitted this pull request during your talk. Well done.