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
I'm trying to represent an acyclic graph structure and need to be able use multiple has_many/belong_to refering back to the same table.
The problem is, even if I can specify the foreign_key in a belongs_to , I cant specify in the has_many what that belongs_to field is. In fact even in a simple relationship Owner 1 -> M Thing The foreign key set on thing is ignored by the has_many.
It doesnt seem to be helped either by the damn inflector changing what I'm writing (Seriously, that should be removed or at least give us an option to disable it, it was pretty high on the list of rails mistakes), but even if that was fixed, it'd still be pointing at the wrong field.
How do I specify manually the foreign key on the related table in has_many?
The text was updated successfully, but these errors were encountered:
@shayneoneill I spent quite a bit of time adding the ability to override the field used on the has_many relationship but ran into the inflector not being available in a macro. It would have required some seriously bad coding to fix.
I'm trying to represent an acyclic graph structure and need to be able use multiple has_many/belong_to refering back to the same table.
The problem is, even if I can specify the foreign_key in a belongs_to , I cant specify in the has_many what that belongs_to field is. In fact even in a simple relationship Owner 1 -> M Thing The foreign key set on thing is ignored by the has_many.
It doesnt seem to be helped either by the damn inflector changing what I'm writing (Seriously, that should be removed or at least give us an option to disable it, it was pretty high on the list of rails mistakes), but even if that was fixed, it'd still be pointing at the wrong field.
How do I specify manually the foreign key on the related table in has_many?
The text was updated successfully, but these errors were encountered: