Re:Happy Birthday, Ruby
by calaveraDeluxe on Thursday January 10, 2019 @10:56AM
(#18874741)
I'm curious, where does pluralization of table names bring runtime overhead? AFAIK, they are stored in the model and not generated every time they are needed.
[ Parent
| on HN ]
Re:Happy Birthday, Ruby
by lowercased on Friday January 11, 2019 @10:13AM
(#18884035)
apparently, my bad. my earlier reading of rails from years ago was that this was runtime inflection, not at generation time.
it still, imo, adds some cognitive overhead, and other orms I've used (grails/gorm, for example), don't try to pluralize. you can pluralize by hand if you want to, but the default is just to name a table whatever the class name is.
It does bring cognitive overhead, when it's not explicit
But you’re writing an ActiveRecord migration. It’s explicit in the same way that echoing a string out is ‘puts’ instead of ‘print’ because this is Ruby and not Python.
what if you're on a team where your responsibilities are divided and you only touch ActiveRecord sporadically?
What does ActiveRecord consider the plural of "fish"?