aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/Problem.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-05-28 16:07:57 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-05-28 16:07:57 +0100
commit959012b397c40638eaa62cd911f416f605043330 (patch)
tree6fcfd0325d02f89c12a83ceaea39966dfa3b454d /perllib/FixMyStreet/DB/Result/Problem.pm
parentc86fb4cfa6fdf62c5d0ba968b6fda7eb46c3d027 (diff)
parent2e94d363be99e83a24ed7b14c6dd00480b9afc93 (diff)
Merge branch 'bromley'
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm')
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm13
1 files changed, 12 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index 532c209d8..9cbaef6c2 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -85,7 +85,7 @@ __PACKAGE__->add_columns(
"geocode",
{ data_type => "bytea", is_nullable => 1 },
"send_fail_count",
- { data_type => "integer", default_value => 0, is_nullable => 0 },
+ { data_type => "integer", is_nullable => 1 },
"send_fail_reason",
{ data_type => "text", is_nullable => 1 },
"send_fail_timestamp",
@@ -704,6 +704,17 @@ sub update_from_open311_service_request {
return 1;
}
+sub update_send_failed {
+ my $self = shift;
+ my $msg = shift;
+
+ $self->update( {
+ send_fail_count => $self->send_fail_count + 1,
+ send_fail_timestamp => \'ms_current_timestamp()',
+ send_fail_reason => $msg
+ } );
+}
+
# we need the inline_constructor bit as we don't inherit from Moose
__PACKAGE__->meta->make_immutable( inline_constructor => 0 );