From: Arthur Axel 'fREW' Schmidt Date: Thu, 25 Feb 2010 05:00:53 +0000 (-0600) Subject: migrate unneeded code out of main class and into delegate class X-Git-Tag: v0.001000_01~123 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d23c7c771d9f64d59bff4043b6493c795d9282af;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git migrate unneeded code out of main class and into delegate class --- diff --git a/lib/DBIx/Class/DeploymentHandler.pm b/lib/DBIx/Class/DeploymentHandler.pm index 988adc1..c06f124 100644 --- a/lib/DBIx/Class/DeploymentHandler.pm +++ b/lib/DBIx/Class/DeploymentHandler.pm @@ -3,12 +3,8 @@ package DBIx::Class::DeploymentHandler; use Moose; use Method::Signatures::Simple; require DBIx::Class::Schema; # loaded for type constraint -require DBIx::Class::Storage; # loaded for type constraint require DBIx::Class::ResultSet; # loaded for type constraint use Carp::Clan '^DBIx::Class::DeploymentHandler'; -use SQL::Translator; -require SQL::Translator::Diff; -use Try::Tiny; with 'DBIx::Class::DeploymentHandler::WithSqltDeployMethod'; @@ -43,18 +39,6 @@ has backup_directory => ( # configuration predicate => 'has_backup_directory', ); -has storage => ( - isa => 'DBIx::Class::Storage', - is => 'ro', - lazy_build => 1, -); - -method _build_storage { - my $s = $self->schema->storage; - $s->_determine_driver; - $s -} - has do_backup => ( # configuration isa => 'Bool', is => 'ro', diff --git a/lib/DBIx/Class/DeploymentHandler/SqltDeployMethod.pm b/lib/DBIx/Class/DeploymentHandler/SqltDeployMethod.pm index 255bdfd..230790c 100644 --- a/lib/DBIx/Class/DeploymentHandler/SqltDeployMethod.pm +++ b/lib/DBIx/Class/DeploymentHandler/SqltDeployMethod.pm @@ -2,6 +2,9 @@ package DBIx::Class::DeploymentHandler::SqltDeployMethod; use Moose; use Method::Signatures::Simple; use Try::Tiny; +use SQL::Translator; +require SQL::Translator::Diff; +require DBIx::Class::Storage; # loaded for type constraint use Carp 'carp';