If you want to check if associations of an object have been eager loaded, use the loaded? method:
@blogpost = Post.includes(:comments).find(1) @blogpost.comments.loaded? => true @blogpost = Post.find(1) @blogpost.comments.loaded? => false
This might for example be useful to test eager loading in your tests.
there’s performance
You can use HTML tags for formatting. Wrap code in <code> tags and multiple lines of code in <pre><code> tags.