aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-04-01 10:47:11 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-04-04 17:50:55 +0100
commit98e61f99be442523fdfb38e95d9a8c2132ea0405 (patch)
tree4640cacbaf8392cb7c4df332a3a7bc6b19fb7b47 /perllib/FixMyStreet/DB
parent8ca5583e62b1c24128b8d691a8b5f5236ce99eef (diff)
Factor to common FixMyStreet::MapIt call.
Diffstat (limited to 'perllib/FixMyStreet/DB')
-rw-r--r--perllib/FixMyStreet/DB/Factories.pm4
-rw-r--r--perllib/FixMyStreet/DB/Result/Body.pm8
2 files changed, 6 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/DB/Factories.pm b/perllib/FixMyStreet/DB/Factories.pm
index 4cbab4753..5af9ed38f 100644
--- a/perllib/FixMyStreet/DB/Factories.pm
+++ b/perllib/FixMyStreet/DB/Factories.pm
@@ -199,7 +199,7 @@ sub create_problem {
package FixMyStreet::DB::Factory::Body;
use parent -norequire, "FixMyStreet::DB::Factory::Base";
-use mySociety::MaPit;
+use FixMyStreet::MapIt;
__PACKAGE__->resultset(FixMyStreet::DB->resultset("Body"));
@@ -208,7 +208,7 @@ __PACKAGE__->exclude(['area_id', 'categories']);
__PACKAGE__->fields({
name => __PACKAGE__->callback(sub {
my $area_id = shift->get('area_id');
- my $area = mySociety::MaPit::call('area', $area_id);
+ my $area = FixMyStreet::MapIt::call('area', $area_id);
$area->{name};
}),
body_areas => __PACKAGE__->callback(sub {
diff --git a/perllib/FixMyStreet/DB/Result/Body.pm b/perllib/FixMyStreet/DB/Result/Body.pm
index c04c117ae..37164c990 100644
--- a/perllib/FixMyStreet/DB/Result/Body.pm
+++ b/perllib/FixMyStreet/DB/Result/Body.pm
@@ -134,6 +134,7 @@ __PACKAGE__->rabx_column('extra');
use Moo;
use namespace::clean;
+use FixMyStreet::MapIt;
with 'FixMyStreet::Roles::Translatable',
'FixMyStreet::Roles::Extra';
@@ -182,10 +183,9 @@ sub first_area_children {
my $cobrand = $self->result_source->schema->cobrand;
- my %params = ( type => $cobrand->area_types_children );
- $params{generation} = FixMyStreet->config('MAPIT_GENERATION')
- if FixMyStreet->config('MAPIT_GENERATION');
- my $children = mySociety::MaPit::call('area/children', $body_area->area_id, %params);
+ my $children = FixMyStreet::MapIt::call('area/children', $body_area->area_id,
+ type => $cobrand->area_types_children,
+ );
return $children;
}