From a3a903faef2e904f810e84323b04807af25de721 Mon Sep 17 00:00:00 2001 From: Gerhard Jungwirth Date: Tue, 24 Oct 2017 16:01:21 +0200 Subject: [PATCH] TT#23774 remove old config-override method in Model was used to allow specifying a custom config file in order to quickly test manually with a different db Change-Id: I03db8ca922037f9d342a81236e6dfbfe79575c36 --- debian/control | 1 - lib/NGCP/Panel/Model/DB.pm | 26 +++++++------------------- lib/NGCP/Panel/Model/InterceptDB.pm | 18 ++---------------- 3 files changed, 9 insertions(+), 36 deletions(-) diff --git a/debian/control b/debian/control index 6606baee71..7a7799b40e 100644 --- a/debian/control +++ b/debian/control @@ -81,7 +81,6 @@ Depends: libmoosex-classattribute-perl, libmoosex-emulate-class-accessor-fast-perl, libmoosex-method-signatures-perl, - libmoosex-types-perl, libnet-http-perl, libnet-https-any-perl, libnet-telnet-perl, diff --git a/lib/NGCP/Panel/Model/DB.pm b/lib/NGCP/Panel/Model/DB.pm index 95d7c8ee2f..28e879523e 100644 --- a/lib/NGCP/Panel/Model/DB.pm +++ b/lib/NGCP/Panel/Model/DB.pm @@ -1,23 +1,9 @@ package NGCP::Panel::Model::DB; use strict; -use File::ShareDir 'dist_file'; -use Moose; -use MooseX::Types::Moose; -extends 'Catalyst::Model::DBIC::Schema'; - -use Module::Runtime qw(use_module); - -has 'testing' => (is => 'rw', isa => 'Bool', default => 0); - -sub setup { - my ($self) = @_; - if ($self->testing) { - my $config_location = dist_file('NGCP-Schema', 'test.conf'); - use_module('NGCP::Schema::Config')->instance - ->config_file($config_location); - } -} +use warnings; + +use base 'Catalyst::Model::DBIC::Schema'; __PACKAGE__->config( connect_info => [], @@ -34,6 +20,10 @@ sub set_transaction_isolation { ); } +1; + +__END__ + =head1 NAME NGCP::Panel::Model::DB - Catalyst DBIC Schema Model @@ -60,5 +50,3 @@ This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. =cut - -1; diff --git a/lib/NGCP/Panel/Model/InterceptDB.pm b/lib/NGCP/Panel/Model/InterceptDB.pm index c89af92492..dcc438ae95 100644 --- a/lib/NGCP/Panel/Model/InterceptDB.pm +++ b/lib/NGCP/Panel/Model/InterceptDB.pm @@ -1,23 +1,9 @@ package NGCP::Panel::Model::InterceptDB; use strict; -use File::ShareDir 'dist_file'; -use Moose; -use MooseX::Types::Moose; -extends 'Catalyst::Model::DBIC::Schema'; +use warnings; -use Module::Runtime qw(use_module); - -has 'testing' => (is => 'rw', isa => 'Bool', default => 0); - -sub setup { - my ($self) = @_; - if ($self->testing) { - my $config_location = dist_file('NGCP-Schema', 'test.conf'); - use_module('NGCP::Schema::Config')->instance - ->config_file($config_location); - } -} +use base 'Catalyst::Model::DBIC::Schema'; __PACKAGE__->config( connect_info => [],