[CDBI] X is not a column of Y

Perrin Harkins perrin at elem.com
Sat Oct 6 23:49:51 BST 2007

On 10/6/07, Matt S Trout <dbix-class at trout.me.uk> wrote:
> On Fri, Oct 05, 2007 at 09:07:27PM -0400, Edward J. Sabol wrote:
> > Arshavir Grigorian wrote:
> > > Following is my class structure that gives the error described in
> > > my first email. I have tried to cut out all the extraneous stuff.
> > > The error only results when deleting the record.
> >
> > Ah, you didn't mention that before.
> The OP spent several hours on freenode#perl not mentioning that fact either.

I think you guys missed this, from his first mail:
"I am getting the error posted below when I try to delete from a table
that has_many() records in another table."

Arshavir, I'm pretty sure the problem is that you loaded Communication
before Task.  The CDBI docs for has_many say that if you don't have a
has_a method set up to tell it which column to look at, it will use
the moniker of the class, which is "task" in your case, and not a
column.  To fix this, you can load Task first, or use the 3-argument
form of has_many, passing "task_id" as the last arg.

- Perrin

More information about the ClassDBI mailing list