[Dbix-class] patch for InflateColumn::DateTime
Mark Hedges
hedges at ucsd.edu
Sat Aug 5 00:53:43 CEST 2006
Hi,
I could not create an object and set the date field to \q{ NOW() }.
deflate->() should not do anything if the value is a scalar ref,
but should pass it through as-is so it gets turned into raw SQL.
Mark
--- /tmp/DateTime.pm 2006-08-04 15:50:32.000000000 -0700
+++ /usr/local/share/perl/5.8.8/DBIx/Class/InflateColumn/DateTime.pm 2006-08-04 15:50:36.000000000 -0700
@@ -64,6 +64,7 @@
},
deflate => sub {
my ($value, $obj) = @_;
+ return $value if ref $value eq 'SCALAR'; # setting \q{ NOW() } maybe
$obj->_datetime_parser->$format($value);
},
}
More information about the Dbix-class
mailing list