[Dbix-class] What would cause has_many relation accessor to query
and return objects using the wrong table/class ?
Aaron Trevena
aaron.trevena at gmail.com
Mon Jul 28 15:49:16 BST 2008
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 ?
Cheers,
A.
--
http://www.aarontrevena.co.uk
LAMP System Integration, Development and Hosting
More information about the DBIx-Class
mailing list