has_many and '... needs a valid column ...'

[prev] [thread] [next] [Date index for 2005/07/06]

From: Ron Savage
Subject: has_many and '... needs a valid column ...'
Date: 06:20 on 06 Jul 2005
Hi Folks

I have a database with a set of constant tables, and when the db is rebuilt from
scratch I wish to populate these constant tables with data from text files.

But the foreign keys pointing to these records are in tables as yet unpopulated,
and I'm /guessing/ the use of has_many() in the constant tables being populated
are causing an attempt to load objects from those foreign keys, which point to
the constant records.

I have every class in a separate file, so that's not the problem.

I've read about 50 msgs from the archives, found by searching for 'needs a valid
column', but nothing seems to fit the bill.

I see docs for has_many(), but from what I can understand of the docs has_many()
refers to the reverse of this situation I'm in, the latter being more like:
will_have_something_pointing_to_me_later_on().

How do I get out of what seems like a chicken-and-egg situation?
--
Ron Savage
ron@xxxxxx.xxx.xx
http://savage.net.au/index.html


has_many and '... needs a valid column ...'
Ron Savage 06:20 on 06 Jul 2005

Re: has_many and '... needs a valid column ...'
Tony Bowden 07:22 on 06 Jul 2005

Generated at 16:35 on 28 Jul 2005 by mariachi v0.52