A trigger called when following a 'has_a' (again)

[prev] [thread] [next] [Date index for 2004/07/22]

From: Peter Pimley
Subject: A trigger called when following a 'has_a' (again)
Date: 13:41 on 22 Jul 2004
Hello again,

In this thread: 
http://groups.kasei.com/mail/arc/cdbi-talk/2004-07/msg00169.html

... we came up with a messy way of automatically blessing an object 
created in a 'has_a' call to a subclass of itself.  This works fine when 
you're calling a 'has_a' method to get at the object, but not when 
you're using retrieve_all, create, etc.  In all of these other cases, we 
can take a different approach and place a trigger which gets called 
before the object is returned to the user.

So, back to my original problem:  There is no trigger that gets called 
on an object before it is returned from a 'has_a' method.  The docs for 
has_a say that:

        "If the foreign class is another Class::DBI representation we 
will call retrieve() on that class with our value."

But this is not exactly what happens.  I can do a retrieve and my 
trigger gets called, but if I do a 'has_a' from elsewhere, the trigger 
does not get called.  In my opinion this is a bug.  So, I have the 
following questions:

*  Have I missed something?  Is there some trigger that does get called?
*  I am willing to try to fix the problem myself.  If I submit a patch, 
will it get folded into the official source?

I shall immediately reply to this email with a listing for an example 
that recreates the problem.

Thanks again for all the help so far,
Peter Pimley

(message missing)

Re: A trigger called when following a 'has_a'
Peter Pimley 14:17 on 20 Jul 2004

Re: A trigger called when following a 'has_a'
Charles Bailey 14:42 on 20 Jul 2004

Re: A trigger called when following a 'has_a'
Peter Pimley 14:53 on 20 Jul 2004

Re: A trigger called when following a 'has_a'
Charles Bailey 15:22 on 20 Jul 2004

Re: A trigger called when following a 'has_a'
Charles Bailey 15:30 on 20 Jul 2004

Re: A trigger called when following a 'has_a'
Peter Pimley 15:37 on 20 Jul 2004

Re: A trigger called when following a 'has_a'
Charles Bailey 15:47 on 20 Jul 2004

Re: A trigger called when following a 'has_a'
Peter Pimley 10:32 on 21 Jul 2004

A trigger called when following a 'has_a' (again)
Peter Pimley 13:41 on 22 Jul 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52