object key modifier works okay
[dbsrgits/DBIx-Class-ResultSet-WithMetaData.git] / t / lib / DBICTest / Schema / ResultSet / Artist.pm
index a3688f2..4cc4a09 100644 (file)
@@ -27,6 +27,16 @@ method with_substr_key () {
   return $self;
 }
 
+method with_substr_key_obj () {
+  $self->_with_object_meta_key( 
+    substr => sub {
+      my ($hash, $obj) = @_;
+      return substr($obj->name, 0, 3);
+    }
+  );
+  return $self;
+}
+
 method with_substr_old () {
   foreach my $row ($self->all) {
     my $substr = substr($row->name, 0, 3);