I’m new to ror, and i’m stuck with what might be kind of a beginners
Here’s a brief description of what i’m trying to do:
I have two classes, lets say Class_a and Class_b, with their models
“having” several instances of Class_c (via has_many). As far as i
understand it, i have to put those lines in the model of Class_c:
When im trying to save an instance of Class_c (right after saving say
Class_b), im getting an “SQLite3::SQLException: SQL logic error or
missing database: INSERT INTO Class_c”-Error. Can this be caused by the
fact that there is noch Class_a_id?
To make my point clear: Class_c should belong to Class_a OR Class_b.
While saving an instance of Class_c i only have either an instance of
Class_a OR Class_b to refer to.
Is it possible to have many belongs_to relationships in one model? I’m
not seeing how to implement the “c belongs to a OR b”, perhaps someone
can lighten things up for me.
Thanks in advance,