Subject: | RFE ability to tweak data on way in to database |
Hello,
It would help me if there was a hook to allow data going in to the
database to be tweaked by a caller-provided coderef.
I've included a patch below.
I'm currently running a forked version of DBIx::Class::Fixtures which
includes this change. It would help the maintainability of my world if
the change could be merged into the master code.
Regards,
Bill
diff -u -r a/DBIx/Class/Fixtures.pm b/DBIx/Class/Fixtures.pm
--- a/DBIx/Class/Fixtures.pm 2012-03-09 06:19:03.000000000 +0000
+++ b/DBIx/Class/Fixtures.pm 2012-09-20 13:57:31.713591117 +0100
@@ -1384,6 +1384,9 @@
$class->restore($key, $content, $args);
}
}
+ if (defined $self->{fix_insert_data}) {
+ $self->{fix_insert_data}->($self, $HASH1);
+ }
if ( $params->{use_create} ) {
$rs->create( $HASH1 );
} else {