[Bps-public-commit] r14471 - in sd/trunk: .
sartak at bestpractical.com
sartak at bestpractical.com
Thu Jul 24 05:19:26 EDT 2008
Author: sartak
Date: Thu Jul 24 05:19:25 2008
New Revision: 14471
Modified:
sd/trunk/ (props changed)
sd/trunk/lib/App/SD/Record.pm
Log:
r65004 at onn: sartak | 2008-07-24 05:19:03 -0400
Don't add a "created" property every update (we need to check the record's existing properties)
Modified: sd/trunk/lib/App/SD/Record.pm
==============================================================================
--- sd/trunk/lib/App/SD/Record.pm (original)
+++ sd/trunk/lib/App/SD/Record.pm Thu Jul 24 05:19:25 2008
@@ -27,9 +27,14 @@
sub canonicalize_prop_created {
my $self = shift;
my %args = validate(@_, { props => 1, errors => 1});
- my $props = shift;
- my $created = $args{props}->{created}
- || $args{props}->{date};
+
+ my $props = $self->get_props;
+
+ my $created = $args{props}->{created}
+ || $args{props}->{date}
+ || $props->{created}
+ || $props->{date};
+
if (!$created ) {
my $date = DateTime->now;
$args{props}->{created} = $date->ymd." ".$date->hms;
More information about the Bps-public-commit
mailing list