diff options
author | Marius Halden <marius.h@lden.org> | 2017-11-03 16:13:59 +0100 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2017-11-03 16:13:59 +0100 |
commit | 42d874db498d0fabae92d0c87acf99054d92391b (patch) | |
tree | d0cf5afdee3d244c4e5da6fe1ab9acba620634df /perllib/FixMyStreet/App/Model/DB.pm | |
parent | 19a7c5dda85a47a68040c742791e9cd9d3e52be6 (diff) | |
parent | dc7613329c275cd158fdde8faf1c0e301f5b7202 (diff) |
Merge tag 'v2.2' into fiksgatami-dev
Diffstat (limited to 'perllib/FixMyStreet/App/Model/DB.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Model/DB.pm | 21 |
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 |