diff options
author | Struan Donald <struan@exo.org.uk> | 2011-06-06 09:20:38 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-06-06 09:20:38 +0100 |
commit | 819a95ae17f59f1732379926f9738caeb9ff046b (patch) | |
tree | 743c52675d1738618557f46f853ac46dd8b8530f /perllib/FixMyStreet/DB/Result/Alert.pm | |
parent | e26bc99396d3eaefc3fd7d81c010dc4028767690 (diff) | |
parent | b388fd0be5296426225089ed188b3c1cdd802415 (diff) |
Merge branch 'migrate_to_catalyst' of ssh://git.mysociety.org/data/git/public/fixmystreet into migrate_to_catalyst
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Alert.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Alert.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Alert.pm b/perllib/FixMyStreet/DB/Result/Alert.pm index b99c83a45..53cb96ff4 100644 --- a/perllib/FixMyStreet/DB/Result/Alert.pm +++ b/perllib/FixMyStreet/DB/Result/Alert.pm @@ -85,10 +85,18 @@ Sets the state of the alert to confirmed. sub confirm { my $self = shift; - return if $self->confirmed and $self->confirmed == 1 and $self->whendisabled ne 'null'; - $self->confirmed(1); $self->whendisabled(undef); + $self->update; + + return 1; +} + +sub disable { + my $self = shift; + + $self->whendisabled( \'ms_current_timestamp()' ); + $self->update; return 1; } |