aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311/GetUpdates.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-08-17 17:12:26 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2015-08-19 15:47:20 +0100
commit5c79337ad423cd7fc3cada9b7830d90726387987 (patch)
tree61615747eae7483722bea4c94309ef4d1cddac4c /perllib/Open311/GetUpdates.pm
parentf5d6ec933c9fd4d57f9b56fec27f7c746a0706b9 (diff)
Simplify/consolidate body restriction db code.
Make dashboard work properly in two-tier councils, showing reports sent to both. Create an index on the array of the bodies_str column to speed up performance, and use that throughout the code replacing all LIKE scans. This also enables a simplifying tidy of the restriction code.
Diffstat (limited to 'perllib/Open311/GetUpdates.pm')
-rw-r--r--perllib/Open311/GetUpdates.pm3
1 files changed, 1 insertions, 2 deletions
diff --git a/perllib/Open311/GetUpdates.pm b/perllib/Open311/GetUpdates.pm
index 5007a1f82..bc55086f0 100644
--- a/perllib/Open311/GetUpdates.pm
+++ b/perllib/Open311/GetUpdates.pm
@@ -17,9 +17,8 @@ sub get_updates {
api_key => $body->api_key
);
- my $reports = FixMyStreet::App->model('DB::Problem')->search(
+ my $reports = FixMyStreet::App->model('DB::Problem')->to_body($body)->search(
{
- bodies_str => { like => "\%" . $body->id . "\%" },
state => { 'IN', [qw/confirmed fixed/] },
-and => [
external_id => { '!=', undef },