Temp column not in "changing" hash in a constraint

[prev] [thread] [next] [Date index for 2005/02/01]

From: Peter Speltz
Subject: Temp column not in "changing" hash in a constraint
Date: 00:26 on 01 Feb 2005
I'm trying the ConfirmPassword... recipe in cookbook.
http://www.class-dbi.com/cgi-bin/wiki/index.cgi?ConfirmPasswordAtRegistration

In my constraint, the temp column i want to validate against the real password
column isn't ending up in the fourth argument to constraint sub -- the "hash
ref of all new column values being assigned (useful for cross-field
validation)".

I use FromCGI::create_from_cgi to create the object.
MY cdbi version is .96 , FromCGI is .94 and perl is 5.8.5. Here's my code:

__PACKAGE__->columns(TEMP => qw/pw2/);
__PACKAGE__->add_constraint(
 confirm_pass => pw => sub {
    my ($val, $self, $column_name, $changing) = @_;
    return ($val || "") eq ($changing->{pw2} || ""); 
    ### pw2 not in $changing despite the 
 }
);
__PACKAGE__->untaint_columns( 
    'printable'=>[ qw/username pw pw2 owner_table home/],
    'integer'  =>['usr_id', 'is_active']
);

thanks


=====
pjs


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250

Temp column not in "changing" hash in a constraint
Peter Speltz 00:26 on 01 Feb 2005

Generated at 16:58 on 18 Mar 2005 by mariachi v0.52