Need help to understand :source option of has_one/has_many through of Rails
Posted
by
Tri Vuong
on Stack Overflow
See other posts from Stack Overflow
or by Tri Vuong
Published on 2011-01-08T04:51:29Z
Indexed on
2011/01/08
4:53 UTC
Read the original article
Hit count: 175
ruby-on-rails3
Hi
Please help me in understanding the :source option of has_one/has_many through association. The Rails api explanation makes very little sense to me
"Specifies the source association name used by has_many :through queries. Only use it if the name cannot be inferred from the association. has_many :subscribers, :through => :subscriptions will look for either :subscribers or :subscriber on Subscription, unless a :source is given. "
Thanks.
© Stack Overflow or respective owner