aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/User.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-06-23 12:23:46 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-06-23 12:23:46 +0100
commit81c542caf4819268bb6b3cb5c1a445f8e5a10b04 (patch)
tree5b1e7a3a3444cd9a24706d9211c2bc5707ea6f08 /perllib/FixMyStreet/DB/Result/User.pm
parent32ff76afda2411410c28b36055ba01ab7ded248d (diff)
Use update user centrally.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/User.pm')
-rw-r--r--perllib/FixMyStreet/DB/Result/User.pm16
1 files changed, 16 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm
index 30314ffa3..5e18596c2 100644
--- a/perllib/FixMyStreet/DB/Result/User.pm
+++ b/perllib/FixMyStreet/DB/Result/User.pm
@@ -115,4 +115,20 @@ sub answered_ever_reported {
return $has_answered->count > 0;
}
+=head2 alert_for_problem
+
+Returns whether the user is already subscribed to an
+alert for the problem ID provided.
+
+=cut
+
+sub alert_for_problem {
+ my ( $self, $id ) = @_;
+
+ return $self->alerts->find( {
+ alert_type => 'new_updates',
+ parameter => $id,
+ } );
+}
+
1;