[DBIx-Class-Devel] [dbix-class] Feature/cdbi implicit inflate (#51)

Peter Rabbitson notifications at github.com
Thu Jul 24 01:31:48 GMT 2014


This has now been merged at https://github.com/dbsrgits/dbix-class/commit/39e2a212 with the seemingly more correct change:
```
   # Class::DBI allows Non database has_a with implicit deflate and inflate
   # Hopefully the following will catch Non-database tables.
-  if (!$f_class->isa('DBIx::Class') && !$f_class->isa('Class::DBI')){
-    $args{'inflate'} ||= sub { $f_class->new(shift); }; # implicite inflate by calling new
-    $args{'deflate'} ||= sub { my $value = shift; "$value"; }; # implicite deflate by stringification
+  if( !$f_class->isa('DBIx::Class::Row') and !$f_class->isa('Class::DBI::Row') ) {
+    $args{'inflate'} ||= sub { $f_class->new(shift) }; # implicit inflate by calling new
+    $args{'deflate'} ||= sub { shift . '' }; # implicit deflate by stringification
   }
```

Please let me know if this is in fact wrong (perhaps you *do* want to exempt ::ResultSet instances just like ::Row... though it doesn't make much sense)

---
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/dbix-class/pull/51#issuecomment-49957786
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20140723/9720dcbb/attachment.htm>


More information about the DBIx-Class-Devel mailing list