We would like to get our Post model to load all comments.
Right now, we must specify the desired load in find (: all), as shown below:
Post.all(:include => [ :comment ])
Is there a way to make loading load by default at the Post model level, instead of doing it in every find? Something like below:
class Post < ActiveRecord::Base has_many :comments, :include <all comments>
ruby-on-rails activerecord eager-loading
Kevin baker
source share