tweaked search_rs to not be destructive to passed
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / InflateColumn / DateTime.pm
index db6d3a7..f05523c 100644 (file)
@@ -11,7 +11,7 @@ DBIx::Class::InflateColumn::DateTime - Auto-create DateTime objects from date an
 =head1 SYNOPSIS
 
 Load this component and then declare one or more 
-columns to be of the datetime or date datatype.
+columns to be of the datetime, timestamp or date datatype.
 
   package Event;
   __PACKAGE__->load_components(qw/InflateColumn::DateTime/);
@@ -52,6 +52,7 @@ sub register_column {
   $self->next::method($column, $info, @rest);
   return unless defined($info->{data_type});
   my $type = lc($info->{data_type});
+  $type = 'datetime' if ($type eq 'timestamp');
   if ($type eq 'datetime' || $type eq 'date') {
     my ($parse, $format) = ("parse_${type}", "format_${type}");
     $self->inflate_column(