diff options
| author | Matthew Somerville <matthew@mysociety.org> | 2015-08-17 17:12:26 +0100 |
|---|---|---|
| committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2015-08-19 15:47:20 +0100 |
| commit | 5c79337ad423cd7fc3cada9b7830d90726387987 (patch) | |
| tree | 61615747eae7483722bea4c94309ef4d1cddac4c /perllib/FixMyStreet/Cobrand/Default.pm | |
| parent | f5d6ec933c9fd4d57f9b56fec27f7c746a0706b9 (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/FixMyStreet/Cobrand/Default.pm')
| -rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index c3185ea05..8cd392073 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -45,15 +45,6 @@ sub country { return ''; } -=head1 problems_clause - -Returns a hash for a query to be used by problems (and elsewhere in joined -queries) to restrict results for a cobrand. - -=cut - -sub problems_clause {} - =head1 problems Returns a ResultSet of Problems, restricted to a subset if we're on a cobrand @@ -66,20 +57,20 @@ sub problems { return $self->{c}->model('DB::Problem'); } -=head1 site_restriction +=head1 body_restriction -Return a site key and a hash of extra query parameters if the cobrand uses a -subset of the FixMyStreet data. Parameter is any extra data the cobrand needs. -Returns a site key of 0 and an empty hash if the cobrand uses all the data. +Return an extra query parameter to restrict reports to those sent to a +particular body. =cut -sub site_restriction { return {}; } +sub body_restriction {} + sub site_key { return 0; } =head2 restriction -Return a restriction to pull out data saved while using the cobrand site. +Return a restriction to data saved while using this specific cobrand site. =cut |
