On Mon, 28 Jul 2008, Aaron Trevena wrote:

Hi All,

I have a peculiar problem.

I've defined a bunch of has_many relations, but when I call them an
object they use the it's own table and class...

i.e.
---
package CustomField;

...

__PACKAGE__->has_many(custom_field_values => 'CustomFieldValue', {
'foreign.custom_field_id' => 'self.custom_field_id' });
----

yet when I call custom_field_values on a CustomField object I get
CustomField objects back, and it queries the custom_field rather than
custom_field_value table.

No warnings, just the wrong query and wrong object.

I've checked the definitiions of the related classes, they are all
fine and correct, how on earth can has_many get as confused as this ?

Any idea what could be causing this ?


Care to dump the entire contents of both classes involves? Cos at the mo I'm guessing "You typed the wrong table name in one of them".. Failing that, also the code you called, and a test tarball ;)

Jess


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to