work even without journal_user
Yuval Kogman [Tue, 29 Jul 2008 17:52:24 +0000 (17:52 +0000)]
lib/DBIx/Class/Schema/Journal.pm

index f4179c4..a49c828 100644 (file)
@@ -75,20 +75,28 @@ sub connection
 #        print STDERR "$s_name :", $self->class($s_name), "\n";
     }
 
+
+    $self->journal_schema_deploy();
+
     ## Set up relationship between changeset->user_id and this schema's user
-    if(!@{$self->journal_user})
+    if(!@{$self->journal_user || []})
     {
         warn "No Journal User set!";
-        return;
+        return $schema;
     }
 
-    $self->_journal_schema->deploy();
     $self->_journal_schema->class('ChangeSet')->belongs_to('user', @{$self->journal_user});
     $self->_journal_schema->storage->disconnect();
 
     return $schema;
 }
 
+sub journal_schema_deploy
+{
+    my ( $self, @args ) = @_;
+    $self->_journal_schema->deploy( @args );
+}
+
 sub get_audit_log_class_name
 {
     my ($self, $sourcename) = @_;