From: Yuval Kogman Date: Tue, 29 Jul 2008 17:52:24 +0000 (+0000) Subject: work even without journal_user X-Git-Tag: v0.900201~96 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=51b162206a570040c53dbc0f7c9e849aef0f02e1;p=dbsrgits%2FDBIx-Class-Journal.git work even without journal_user --- diff --git a/lib/DBIx/Class/Schema/Journal.pm b/lib/DBIx/Class/Schema/Journal.pm index f4179c4..a49c828 100644 --- a/lib/DBIx/Class/Schema/Journal.pm +++ b/lib/DBIx/Class/Schema/Journal.pm @@ -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) = @_;