Hacker News new | past | comments | ask | show | jobs | submit login

can't the same be achieved with has_many :through association?



Its a bit more complex than that unfortunately.

Since Rails isn't used to include something like a tenant_id, and doesn't support composite primary keys either, you'd have to always hand-write your SQL.

Feel free to take a look at the source - it effectively ends up being a default scope with some additional glue code.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: