On May 1, 2014, at 11:57 AM, Łukasz Niemier <luk...@niemier.pl> wrote:
> It will be nice, if has_* methods will have named option. Example: > > has_many :foos, named: :boos > > # equivalent of > > has_many :boos, class_name: 'Foo', foreign_key: 'foo_id' > > IMHO it is quite often used feature. Also it will be nice to have scoped > option that will allow easy flow with scoped models (i.e. Blog::Posts). -1 on this. The first argument of `has_many` is the name you want to refer to the association by (the root name of all the generated methods), not the pluralized model name. It’s sufficiently confusing that I’m pretty sure your expanded example is incorrect; `Foo` is unlikely to have a column named `foo_id`… —Matt Jones
signature.asc
Description: Message signed with OpenPGP using GPGMail