You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the through option, as I defined in the other issue, I would expect to use the plural name of the association like has_many :owners, through: :car_owners. The issue is that this line doesn't singularize that term which would mean it's looking for a foreign_key car_owners_id (unless the foreign key is specified).
Now, if I'm reading this correctly, since the through option is specified here, it will run this code which calls id. In my case, my "through" table has no id field.
Another example for this issue:
schema "facts"do
has_many :fact_checkers, FactChecker
has_many :checkers, Checker, through::fact_checker# this has to be single to work or foreign_key would need to be specifiedend# only has a fact_id and checker_id
schema "fact_checkers"do
belongs_to :fact, Fact
belongs_to :checker, Checkerend
schema "checkers"do
has_many :fact_checkers, FactChecker
has_many :facts, through::fact_checker# single again here tooend
The text was updated successfully, but these errors were encountered:
This is loosely along the same lines as #98.
When using the
through
option, as I defined in the other issue, I would expect to use the plural name of the association likehas_many :owners, through: :car_owners
. The issue is that this line doesn't singularize that term which would mean it's looking for a foreign_keycar_owners_id
(unless the foreign key is specified).Now, if I'm reading this correctly, since the
through
option is specified here, it will run this code which callsid
. In my case, my "through" table has noid
field.Another example for this issue:
The text was updated successfully, but these errors were encountered: