diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-06-13 18:39:05 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-06-20 15:02:11 +0100 |
commit | e57cbf483790bedfef6496be3c7ffa42882c3ffc (patch) | |
tree | d01788502457f801a846cdac78213df5ecdf1ea5 /perllib/FixMyStreet/DB/Factories.pm | |
parent | a5f311e5147621f285cf31647ce675c502095882 (diff) |
[UK] Remove requirement for fixed body IDs.
Historically in UK cobrands, bodies have had IDs the same as the MapIt
area ID they cover. This can be confusing (if you are setting up a dev
environment, say) and should not be necessary. This commit removes the
requirement entirely, by switching any ID checks to either the name of
the body, or the actual area it covers.
One note: the body name in the test has to match so that we do not get
two bodies both covering 2237 created. This will not be necessary when
the tests are compartmentalized in the next commit.
Diffstat (limited to 'perllib/FixMyStreet/DB/Factories.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Factories.pm | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/DB/Factories.pm b/perllib/FixMyStreet/DB/Factories.pm index e877ffd9f..c3060507e 100644 --- a/perllib/FixMyStreet/DB/Factories.pm +++ b/perllib/FixMyStreet/DB/Factories.pm @@ -44,8 +44,6 @@ __PACKAGE__->fields({ ####################### -# This currently creates special 'UK' bodies, with ID == MapIt area_id. -# We should try and end this, it is just confusing. package FixMyStreet::DB::Factory::Body; use parent -norequire, "FixMyStreet::DB::Factory::Base"; @@ -56,10 +54,6 @@ __PACKAGE__->resultset(FixMyStreet::DB->resultset("Body")); __PACKAGE__->exclude(['area_id', 'categories']); __PACKAGE__->fields({ - id => __PACKAGE__->callback(sub { - my $area_id = shift->get('area_id'); - $area_id; - }), name => __PACKAGE__->callback(sub { my $area_id = shift->get('area_id'); my $area = mySociety::MaPit::call('area', $area_id); |