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.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Model/DB.pm b/perllib/FixMyStreet/App/Model/DB.pm
index 9d09186b8..ffd867485 100644
--- a/perllib/FixMyStreet/App/Model/DB.pm
+++ b/perllib/FixMyStreet/App/Model/DB.pm
@@ -5,19 +5,28 @@ use strict;
use warnings;
use FixMyStreet;
+use Moose;
+
+with 'Catalyst::Component::InstancePerContext';
__PACKAGE__->config(
schema_class => 'FixMyStreet::DB::Schema',
connect_info => sub { FixMyStreet::DB->schema->storage->dbh },
);
+sub build_per_context_instance {
+ my ( $self, $c ) = @_;
+ $self->schema->cache({});
+ return $self;
+}
+
=head1 NAME
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