I have the following structure:
:dependent => true
I’m doing the following to insert the Foo record and it’s dependent Bar
f = Foo.create(…)
This successfully creates and stores f away in the table.
b = Bar.new(params[…])
f.bars << b <-- This should set the foreign key in b automatically.
But I get a ‘key not found’ problem. I get the same problem if I do:
Any help on this would be appreciated. I’ve been on this bug for 2 days