[Bast-commits] r3210 - trunk/DBIx-Class-TimeStamp/lib/DBIx/Class
bricas at dev.catalyst.perl.org
bricas at dev.catalyst.perl.org
Wed Apr 25 17:02:30 GMT 2007
Author: bricas
Date: 2007-04-25 17:02:29 +0100 (Wed, 25 Apr 2007)
New Revision: 3210
Modified:
trunk/DBIx-Class-TimeStamp/lib/DBIx/Class/TimeStamp.pm
Log:
don't override user-set values for insert and update
Modified: trunk/DBIx-Class-TimeStamp/lib/DBIx/Class/TimeStamp.pm
===================================================================
--- trunk/DBIx-Class-TimeStamp/lib/DBIx/Class/TimeStamp.pm 2007-04-25 01:29:07 UTC (rev 3209)
+++ trunk/DBIx-Class-TimeStamp/lib/DBIx/Class/TimeStamp.pm 2007-04-25 16:02:29 UTC (rev 3210)
@@ -84,6 +84,7 @@
my @columns = @{ $self->__column_timestamp_triggers()->{on_create} };
foreach my $column ( @columns ) {
+ next if defined $self->get_column( $column );
$self->$column($now);
}
@@ -94,10 +95,11 @@
my $self = shift;
my $now = $self->get_timestamp();
-
+ my %dirty = $self->get_dirty_columns();
my @columns = @{ $self->__column_timestamp_triggers()->{on_update} };
foreach my $column ( @columns ) {
+ next if exists $dirty{ $column };
$self->$column($now);
}
@@ -131,3 +133,4 @@
=cut
1;
+
More information about the Bast-commits
mailing list