diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-01-02 12:25:50 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-01-03 14:22:30 +0000 |
commit | c900b5057c6d3a9c389a0d0ac8524ab2e3abd8f8 (patch) | |
tree | 02b49c7f2705ae733b7a12006c60a235fb5ebf27 /perllib/FixMyStreet/App/Controller/Report/New.pm | |
parent | 39e549b3e1978cc5d6b29ba37f57ca90d3c391cb (diff) |
Add some new Body model helper methods.
And use the existing ones more.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index ca4fa2fd2..d74af5a84 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -617,10 +617,7 @@ sub setup_categories_and_bodies : Private { my $all_areas = $c->stash->{all_areas}; my $first_area = ( values %$all_areas )[0]; - my @bodies = $c->model('DB::Body')->search( - { 'body_areas.area_id' => [ keys %$all_areas ], deleted => 0 }, - { join => 'body_areas' } - )->all; + my @bodies = $c->model('DB::Body')->active->for_areas(keys %$all_areas)->all; my %bodies = map { $_->id => $_ } @bodies; my $first_body = ( values %bodies )[0]; |