From: Arthur Axel "fREW" Schmidt Date: Thu, 18 Feb 2010 16:14:38 +0000 (+0000) Subject: different namespace for each journal so two different journals in the same interprete... X-Git-Tag: v0.900201~39 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=928b6c45dbdfa0a0a957f70f8fafe20e5698395b;p=dbsrgits%2FDBIx-Class-Journal.git different namespace for each journal so two different journals in the same interpreter dont mingle --- diff --git a/lib/DBIx/Class/Schema/Journal.pm b/lib/DBIx/Class/Schema/Journal.pm index 48c1056..58d2394 100644 --- a/lib/DBIx/Class/Schema/Journal.pm +++ b/lib/DBIx/Class/Schema/Journal.pm @@ -28,11 +28,14 @@ sub _journal_schema_prototype { return $proto; } + my $c = blessed($self)||$self; + my $journal_schema_class = "${c}::_JOURNAL"; + Class::C3::Componentised->inject_base($journal_schema_class, 'DBIx::Class::Schema::Journal::DB'); my $proto = $self->__journal_schema_prototype ( - DBIx::Class::Schema::Journal::DB->compose_namespace + $journal_schema_class->compose_namespace ( - (blessed($self)||$self) . '::Journal' + $c.'::Journal' ) ); my $comp = $self->journal_component || "Journal"; @@ -119,7 +122,7 @@ sub create_journal_for my $audit_source = $s_name.$audit; my $class = blessed($journal_schema) . "::$audit_source"; - Class::C3::Componentised->inject_base($class, "DBIx::Class::Schema::Journal::DB::$audit"); + Class::C3::Componentised->inject_base($class, "DBIx::Class::Schema::Journal::DB::$audit"); $class->journal_define_table($source);