Re: select trigger and warnings

[prev] [thread] [next] [Date index for 2004/11/17]

From: Tony Bowden
Subject: Re: select trigger and warnings
Date: 11:01 on 17 Nov 2004
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

select trigger and warnings
Carlos Vicente 18:43 on 16 Nov 2004

Re: select trigger and warnings
Tony Bowden 11:01 on 17 Nov 2004

Re: select trigger and warnings
Carlos Vicente 01:49 on 18 Nov 2004

Re: select trigger and warnings
Carlos Vicente 00:34 on 19 Nov 2004

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