[Dbix-class] What would cause has_many relation accessor to query and return objects using the wrong table/class ?

Matt S Trout dbix-class at trout.me.uk
Wed Jul 30 11:30:47 BST 2008


On Tue, Jul 29, 2008 at 11:21:30AM +0100, Aaron Trevena wrote:
> 2008/7/28 Matt S Trout <dbix-class at trout.me.uk>:
> > On Mon, Jul 28, 2008 at 03:49:16PM +0100, 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 think you've somehow registered an extra result source for one of the
> > two and/or messed up ->source_name.
> >
> > Can you possibly produce at the very least redacted versions of the
> > CustomField -and- CustomFieldValue classes, and dump
> >
> > My::Schema->source_registrations
> >
> > plus
> >
> > $schema->source_registrations
> >
> > and see if you can spot a problem - and if you can't, also post recated
> > versions of those.
> 
> I've managed to isolate the problem to only occuring after the object
> has been thawed from the cache and the source refreshed, but no
> further than that as the data I'm using for the relationships should
> be pulled from said cache anyway.
> 
> It's very puzzling, everything works elsewhere apart from relations
> from this thawed object. No time to investigate it further at the
> moment I'm afraid.

Understood. If it's only happening post-thaw when the extra data -isn't-
in the cache, then I'm not too worried about categorising it under "doctor,
it hurts when I do this" and moving on.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the DBIx-Class mailing list