[Bast-commits] r6545 - in DBIx-Class/0.08/branches/rsrc_in_storage: lib/DBIx/Class/Storage t

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Mon Jun 8 11:14:09 GMT 2009


Author: ribasushi
Date: 2009-06-08 11:14:08 +0000 (Mon, 08 Jun 2009)
New Revision: 6545

Modified:
   DBIx-Class/0.08/branches/rsrc_in_storage/lib/DBIx/Class/Storage/DBI.pm
   DBIx-Class/0.08/branches/rsrc_in_storage/t/89inflate_datetime.t
Log:
Commit failing test and thoughts on search arg deflation

Modified: DBIx-Class/0.08/branches/rsrc_in_storage/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/branches/rsrc_in_storage/lib/DBIx/Class/Storage/DBI.pm	2009-06-08 11:00:54 UTC (rev 6544)
+++ DBIx-Class/0.08/branches/rsrc_in_storage/lib/DBIx/Class/Storage/DBI.pm	2009-06-08 11:14:08 UTC (rev 6545)
@@ -1249,6 +1249,14 @@
     }
   }
 
+  # This would be the point to deflate anything found in $condition
+  # (and leave $attrs->{bind} intact). Problem is - inflators historically
+  # expect a row object. And all we have is a resultsource (it is trivial
+  # to extract deflator coderefs via $alias2source above).
+  #
+  # I don't see a way forward other than changing the way deflators are
+  # invoked, and that's just bad...
+
   my @args = ('select', $attrs->{bind}, $ident, $bind_attrs, $select, $condition, $order);
   if ($attrs->{software_limit} ||
       $sql_maker->_default_limit_syntax eq "GenericSubQ") {

Modified: DBIx-Class/0.08/branches/rsrc_in_storage/t/89inflate_datetime.t
===================================================================
--- DBIx-Class/0.08/branches/rsrc_in_storage/t/89inflate_datetime.t	2009-06-08 11:00:54 UTC (rev 6544)
+++ DBIx-Class/0.08/branches/rsrc_in_storage/t/89inflate_datetime.t	2009-06-08 11:14:08 UTC (rev 6545)
@@ -13,7 +13,7 @@
 
 my $schema = DBICTest->init_schema();
 
-plan tests => 53;
+plan tests => 57;
 
 SKIP: {
   eval { require DateTime::Format::MySQL };
@@ -29,6 +29,14 @@
 my $starts = $event->starts_at;
 is("$starts", '2006-04-25T22:24:33', 'Correct date/time');
 
+ok(my $row =
+  $schema->resultset('Event')->search({ starts_at => $starts })->single);
+is(eval { $row->id }, 1, 'DT in search');
+
+ok($row =
+  $schema->resultset('Event')->search({ starts_at => { '>=' => $starts } })->single);
+is(eval { $row->id }, 1, 'DT in search with condition');
+
 # create using DateTime
 my $created = $schema->resultset('Event')->create({
     starts_at => DateTime->new(year=>2006, month=>6, day=>18),




More information about the Bast-commits mailing list