aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/Problem.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-01-08 15:55:48 +0000
committerMatthew Somerville <matthew@mysociety.org>2020-01-09 17:31:44 +0000
commita47cdf03631855fd83866b932161eaa8ccf0c8b5 (patch)
tree8589ba85501132a7eb14fb75e78eabe37503882d /perllib/FixMyStreet/DB/Result/Problem.pm
parentc38ca476d282c8e369ae6788b3400c4cc41f3e20 (diff)
[Inactive] Add option to fully delete reports.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm')
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index a188d9c2b..d9bb8e125 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -1187,4 +1187,15 @@ has inspection_log_entry => (
},
);
+has alerts => (
+ is => 'ro',
+ lazy => 1,
+ default => sub {
+ my $self = shift;
+ return $self->result_source->schema->resultset('Alert')->search({
+ alert_type => 'new_updates', parameter => $self->id
+ });
+ },
+);
+
1;