{"id":924,"date":"2010-09-20T20:45:40","date_gmt":"2010-09-21T00:45:40","guid":{"rendered":"http:\/\/blogs.law.harvard.edu\/lianaleahy\/?p=924"},"modified":"2010-09-20T18:46:35","modified_gmt":"2010-09-20T22:46:35","slug":"incredulosity","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/2010\/09\/20\/incredulosity\/","title":{"rendered":"INCREDULOSITY!"},"content":{"rendered":"<p>Adding a counter to your models is a nifty little rails feature that requires very little setup.  One more reason to revisit these old episodes is a little gem tossed in to <a href=\"http:\/\/railscasts.com\/episodes\/23-counter-cache-column\">episode #23<\/a>.<\/p>\n<p>The <strong>pluralize method<\/strong>.  Rails does its pluralizations with the Inflector class.  You can read all about it from <a href=\"http:\/\/slash7.com\/2005\/11\/17\/rails-howto-pluralizing\/\">Amy Hoy<\/a>:<\/p>\n<blockquote><p>Rails\u2019 use of pluralization is pretty smart, albeit not perfect. From \u201cperson\u201d you get \u201cpeople,\u201d and \u201cmouse\u201d you get \u201cmice.\u201d If you\u2019re tracking deer, though, watch out for \u201cdeers.\u201d<\/p><\/blockquote>\n<p>Here are a few of her examples:<br \/>\n<code>Inflector.pluralize('test') =&gt; \"tests\"<br \/>\nInflector.pluralize('mouse') =&gt; \"mice\"<br \/>\nInflector.pluralize('geese') =&gt; \"geeses\"<br \/>\n\"mouse\".pluralize =&gt; \"mice\"<br \/>\nexit 1.ordinalize =&gt; \"1st\"<\/code><\/p>\n<p><a href=\"http:\/\/slash7.com\/about\/\">Amy Hoy<\/a> is wicked cool and one of my ror rockstar role models.  <\/p>\n<blockquote><p>Wait wait\u2014code AND design chops? INCREDULOSITY!<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Adding a counter to your models is a nifty little rails feature that requires very little setup. One more reason to revisit these old episodes is a little gem tossed in to episode #23. The pluralize method. Rails does its pluralizations with the Inflector class. You can read all about it from Amy Hoy: Rails\u2019 [&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-924","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\/924","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=924"}],"version-history":[{"count":5,"href":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/wp-json\/wp\/v2\/posts\/924\/revisions"}],"predecessor-version":[{"id":929,"href":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/wp-json\/wp\/v2\/posts\/924\/revisions\/929"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/wp-json\/wp\/v2\/media?parent=924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/wp-json\/wp\/v2\/categories?post=924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/lianaleahy\/wp-json\/wp\/v2\/tags?post=924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}