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
changes/84/16484/2
Gerhard Jungwirth 9 years ago
parent 21975ad88c
commit a3a903faef

1
debian/control vendored

@ -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,

@ -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;

@ -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 => [],

Loading…
Cancel
Save