$self->next::method(@_);
}
+# sub load_classes
+# {
+# my $class = shift;
+
+
+# $class->next::method(@_);
+
+# }
+
sub connection
{
my $self = shift;
# print STDERR join(":", $self->sources), "\n";
- my $journal_schema = DBIx::Class::Schema::Journal::DB->connect(@{ $self->journal_connection || $self->storage->connect_info });
-# print STDERR "conn", $journal_schema->storage->connect_info;
- if($self->journal_storage_type)
+ my $journal_schema;
+ if(!defined($self->journal_connection))
+ {
+ ## If no connection, use the same schema/storage etc as the user
+ DBIx::Class::Componentised->inject_base(ref $self, 'DBIx::Class::Schema::Journal::DB');
+ $journal_schema = $self;
+ }
+ else
{
- $journal_schema->storage_type($self->journal_storage_type);
+ $journal_schema = DBIx::Class::Schema::Journal::DB->connect(@{ $self->journal_connection });
+ if($self->journal_storage_type)
+ {
+ $journal_schema->storage_type($self->journal_storage_type);
+ }
}
## get our own private version of the journaling sources
my $self = shift;
my %args = @_;
my $db_file = "t/var/DBIxClass.db";
+ my $db_audit = 't/var/Audit.db';
unlink($db_file) if -e $db_file;
unlink($db_file . "-journal") if -e $db_file . "-journal";
+ unlink($db_audit) if -e $db_audit;
+ unlink($db_audit . "-journal") if -e $db_audit . "-journal";
mkdir("t/var") unless -d "t/var";
my $dsn = $ENV{"DBICTEST_DSN"} || "dbi:SQLite:${db_file}";