Re: select trigger and warnings
[prev]
[thread]
[next]
[Date index for 2004/11/17]
On Tue, Nov 16, 2004 at 10:43:36AM -0800, Carlos Vicente wrote:
> Ipblock->add_trigger( deflate_for_create => \&ip2int );
> Ipblock->add_trigger( deflate_for_update => \&ip2int );
> Ipblock->add_trigger( select => \&int2ip );
> These methods do some calculations and set the value using
> $self->address($value).
In a before_create trigger you need to use
$self->_attribute_store(address => $value)
rather than calling the ->address method directly.
Calling ->address() will set the address field to be modified at the
next UPDATE, but create doesn't call UPDATE just INSERT. So when the
object goes out of scope you'll get the normal warnings about having an
altereredf ield not having been written to the database.
This isn't particularly ideal, but I don't have a good solution at this
point.
Tony
|
|
Re: select trigger and warnings
Tony Bowden 11:01 on 17 Nov 2004
|