5 ms·
pluralization seems to be somewhat orthogonal to the "no standards" issue you raise; one could have introduced standard rules to help with that 'wild west' and
by lowercased 8y ago
pluralization seems to be somewhat orthogonal to the "no standards" issue you raise; one could have introduced standard rules to help with that 'wild west' and still left out pluralization. pluralization brings with it runtime overhead and edge cases (which can be dealt with with more runtime overhead, of course).
- calaveraDeluxe 8y agoI'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.
- dnautics 8y agoIt does bring cognitive overhead, when it's not explicit
- Karunamon 8y agoBut 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.
- dnautics 8y agowhat 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"?
- sethrin 8y agoYou can change the inflections if you need to do so. ActiveRecord by default considers fish to be an uncountable noun, so the plural would be "fish".
- lowercased 8y agoapparently, 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.