diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-12-13 16:30:47 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-12-15 17:24:51 +0000 |
commit | 6375eb5d31aa250f5d990d6d6420dd04cf25e3bf (patch) | |
tree | 73129be72ef59a03faa88557fd3869f6b27bd5f1 /perllib/FixMyStreet/DB/Result/Problem.pm | |
parent | 5f579853c13959d314b2155703fd03642be03443 (diff) |
Update priorities in inspect form on cat. change.
Different categories may have a different list of priorities, so store
them all and update as the category changes.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index ab6f20050..91b8d449e 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -680,16 +680,7 @@ alphabetical order of name. sub response_priorities { my $self = shift; - return $self->result_source->schema->resultset('ResponsePriority')->search( - { - 'me.body_id' => $self->bodies_str_ids, - 'contact.category' => [ $self->category, undef ], - }, - { - order_by => 'name', - join => { 'contact_response_priorities' => 'contact' }, - } - ); + return $self->result_source->schema->resultset('ResponsePriority')->for_bodies($self->bodies_str_ids, $self->category); } # returns true if the external id is the council's ref, i.e., useful to publish it |