set boolean flag to something more obscure to avoid collisions master
skaufman [Mon, 23 Jan 2012 23:31:15 +0000 (23:31 +0000)]
lib/Catalyst/TraitFor/Model/DBIC/Schema/SharedDatabaseConnection.pm

index 7918d15..2193ff9 100644 (file)
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 
 package Catalyst::TraitFor::Model::DBIC::Schema::SharedDatabaseConnection;
-
+$Catalyst::TraitFor::Model::DBIC::Schema::SharedDatabaseConnection::VERSION = '0.01';
 use Moose::Role;
 
 has parent_model => (
@@ -11,16 +11,16 @@ has parent_model => (
     required => 1,
 );
 
-has cloned => (
+has _cloned_parent_model => (
     is      => 'rw',
     default => 0,
 );
 around ACCEPT_CONTEXT => sub {
     my ( $orig, $self, $app, @rest ) = ( shift, shift, @_ );
-    unless ( $self->cloned ) {
+    unless ( $self->_cloned_parent_model ) {
         $self->schema->storage(
             $app->model( $self->parent_model )->schema->storage );
-        $self->cloned(1);
+        $self->_cloned_parent_model(1);
     }
     $self->$orig( $app, @rest );
 };