X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FCDBICompat%2FGetSet.pm;h=dd621f27da7591287de9f27fd4e26baedd0c452e;hb=7f3fd2621c5509873aa30e7a68b7dd670421cc86;hp=6b98e793e700a8f2337627efef44638ad02278fa;hpb=75d079145a507a0e5ff89b2676d383f4fd1a5511;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/CDBICompat/GetSet.pm b/lib/DBIx/Class/CDBICompat/GetSet.pm index 6b98e79..dd621f2 100644 --- a/lib/DBIx/Class/CDBICompat/GetSet.pm +++ b/lib/DBIx/Class/CDBICompat/GetSet.pm @@ -16,7 +16,17 @@ sub get { } sub set { - return shift->set_column(@_); + my($self, %data) = @_; + + # set_columns() is going to do a string comparison before setting. + # This breaks on DateTime objects (whose comparison is arguably broken) + # so we stringify anything first. + for my $key (keys %data) { + next unless ref $data{$key}; + $data{$key} = "$data{$key}"; + } + + return shift->set_columns(\%data); } 1;