Re: [CDBI] X is not a column of Y
"Perrin Harkins" <[email protected]> Sat, 6 Oct 2007 18:49:51 -0400
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Message-ID | <[email protected]> |
On 10/6/07, Matt S Trout <dbix-class-uY5y5/[email protected]> 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