[Bast-commits] r4606 -
DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn
matthewt at dev.catalyst.perl.org
matthewt at dev.catalyst.perl.org
Wed Jul 23 21:09:26 BST 2008
Author: matthewt
Date: 2008-07-23 21:09:26 +0100 (Wed, 23 Jul 2008)
New Revision: 4606
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn/DateTime.pm
Log:
fix cycle, reformat to 80 cols
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn/DateTime.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn/DateTime.pm 2008-07-23 20:09:22 UTC (rev 4605)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn/DateTime.pm 2008-07-23 20:09:26 UTC (rev 4606)
@@ -78,6 +78,8 @@
$timezone = $info->{extra}{timezone};
}
+ my $undef_if_invalid = $info->{datetime_undef_if_invalid};
+
if ($type eq 'datetime' || $type eq 'date') {
my ($parse, $format) = ("parse_${type}", "format_${type}");
$self->inflate_column(
@@ -86,7 +88,8 @@
inflate => sub {
my ($value, $obj) = @_;
my $dt = eval { $obj->_datetime_parser->$parse($value); };
- die "Error while inflating ${value} for ${column} on ${self}: $@" if $@ and not $info->{datetime_undef_if_invalid};
+ die "Error while inflating ${value} for ${column} on ${self}: $@"
+ if $@ and not $undef_if_invalid;
$dt->set_time_zone($timezone) if $timezone;
return $dt;
},
More information about the Bast-commits
mailing list