{"id":908,"date":"2010-09-10T17:16:39","date_gmt":"2010-09-10T21:16:39","guid":{"rendered":"http:\/\/blogs.law.harvard.edu\/lianaleahy\/?p=908"},"modified":"2010-09-10T17:20:50","modified_gmt":"2010-09-10T21:20:50","slug":"everyone-poops","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/2010\/09\/10\/everyone-poops\/","title":{"rendered":"Everyone Poops"},"content":{"rendered":"<p>We all know that hitting the database as little as possible is one of the keys to improved performance.  But rails can sometimes feel like a magic unicorn you don&#8217;t want to touch lest it fade into the mist.  <\/p>\n<p>Go ahead.  Look that gift horse in the mouth.  <a href=\"http:\/\/www.amazon.com\/Everyone-Poops-My-Body-Science\/dp\/0916291456\">Even Unicorns poop<\/a> and it&#8217;s all there in your development log.<\/p>\n<p>Sorry for the poop comment.  We&#8217;re potty training at my house.<\/p>\n<p>But in keeping with the poop theme here, there&#8217;s a lot of valuable information in your output.<\/p>\n<p>In <a href=\"http:\/\/railscasts.com\/episodes\/22-eager-loading\">episode 22<\/a>, Ryan shows us eager loading.  By using <strong>:include<\/strong> in your finders, you can squeeze multiple queries into one. So take a second look at those loops and check out that dot notation.<\/p>\n<p>There are other ways of joining on tables, such as using <strong>:join<\/strong>.  Which makes me wonder. Any other examples of ways to take advantage of eager loading?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We all know that hitting the database as little as possible is one of the keys to improved performance. But rails can sometimes feel like a magic unicorn you don&#8217;t want to touch lest it fade into the mist. Go ahead. Look that gift horse in the mouth. Even Unicorns poop and it&#8217;s all there [&hellip;]<\/p>\n","protected":false},"author":1911,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2850,16534,2403],"tags":[],"class_list":["post-908","post","type-post","status-publish","format-standard","hentry","category-professional","category-railscasts-project","category-ruby-on-rails"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/wp-json\/wp\/v2\/posts\/908","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/wp-json\/wp\/v2\/users\/1911"}],"replies":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/wp-json\/wp\/v2\/comments?post=908"}],"version-history":[{"count":9,"href":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/wp-json\/wp\/v2\/posts\/908\/revisions"}],"predecessor-version":[{"id":921,"href":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/wp-json\/wp\/v2\/posts\/908\/revisions\/921"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/wp-json\/wp\/v2\/media?parent=908"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/wp-json\/wp\/v2\/categories?post=908"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/wp-json\/wp\/v2\/tags?post=908"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}