Hacker Newsnew | past | comments | ask | show | jobs | submit | calaveraDeluxe's commentslogin

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.


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"?


You 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".


I don't think this is true. I just tried to replicate it with 2 different hostsnames pointing to 127.0.0.1 in my /etc/hosts. js loaded from origin2.foo on a page with an origin of origin1.foo can XHR things from origin1.foo, but not from origin2.foo.

Interestingly, MDN leads the article on same-origin policy with this sentence:

The same-origin policy is a critical security mechanism that restricts how a document or script loaded from one origin can interact with a resource from another origin.

This seems to support the way that OP described how SOP works.


As others have pointed out, that article is now 15 years old.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: