diff options
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 27648ddad..855732f83 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -1020,4 +1020,16 @@ sub static_map { }; } +has shortlisted_user => ( + is => 'ro', + lazy => 1, + default => sub { + my $self = shift; + my $user = $self->result_source->schema->resultset('User')->search( + { 'user_planned_reports.report_id' => $self->id }, + { join => 'user_planned_reports' })->first; + return $user; + }, +); + 1; |