aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Model/DB.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Model/DB.pm')
-rw-r--r--perllib/FixMyStreet/App/Model/DB.pm21
1 files changed, 18 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Model/DB.pm b/perllib/FixMyStreet/App/Model/DB.pm
index ac1f98dc9..c116abffc 100644
--- a/perllib/FixMyStreet/App/Model/DB.pm
+++ b/perllib/FixMyStreet/App/Model/DB.pm
@@ -5,11 +5,26 @@ use strict;
use warnings;
use FixMyStreet;
+use Catalyst::Utils;
+use Moose;
+
+with 'Catalyst::Component::InstancePerContext';
__PACKAGE__->config(
- schema_class => 'FixMyStreet::DB',
- connect_info => sub { FixMyStreet::DB->storage->dbh },
+ schema_class => 'FixMyStreet::DB::Schema',
+ connect_info => sub { FixMyStreet::DB->schema->storage->dbh },
);
+__PACKAGE__->config(
+ traits => ['QueryLog::AdoptPlack'],
+)
+ if Catalyst::Utils::env_value( 'FixMyStreet::App', 'DEBUG' );
+
+sub build_per_context_instance {
+ my ( $self, $c ) = @_;
+ # $self->schema->cobrand($c->cobrand);
+ $self->schema->cache({});
+ return $self;
+}
=head1 NAME
@@ -17,7 +32,7 @@ FixMyStreet::App::Model::DB - Catalyst DBIC Schema Model
=head1 DESCRIPTION
-L<Catalyst::Model::DBIC::Schema> Model using schema L<FixMyStreet::DB>
+L<Catalyst::Model::DBIC::Schema> Model using schema L<FixMyStreet::DB::Schema>
=cut