diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-12-13 15:48:48 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-12-15 00:11:06 +0000 |
commit | 9fb130a0ab1bd36e977439b7697fba5fec5b1f00 (patch) | |
tree | e9c8f3fce2ecf110172b9359e48c436b10e66fee /perllib/Open311 | |
parent | 48d290abd549a623e3af4b62127668cf92018d9c (diff) |
Rename council column to bodies_str, and all the related code.
Diffstat (limited to 'perllib/Open311')
-rw-r--r-- | perllib/Open311/GetServiceRequestUpdates.pm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm index 81b50406b..4e64e350f 100644 --- a/perllib/Open311/GetServiceRequestUpdates.pm +++ b/perllib/Open311/GetServiceRequestUpdates.pm @@ -14,7 +14,7 @@ has verbose => ( is => 'ro', default => 0 ); sub fetch { my $self = shift; - my $councils = FixMyStreet::App->model('DB::Body')->search( + my $bodies = FixMyStreet::App->model('DB::Body')->search( { send_method => 'Open311', send_comments => 1, @@ -23,24 +23,24 @@ sub fetch { } ); - while ( my $council = $councils->next ) { + while ( my $body = $bodies->next ) { my $o = Open311->new( - endpoint => $council->endpoint, - api_key => $council->api_key, - jurisdiction => $council->jurisdiction, + endpoint => $body->endpoint, + api_key => $body->api_key, + jurisdiction => $body->jurisdiction, ); - if ( $council->area_id =~ /2482/ ) { + if ( $body->area_id == 2482 ) { my $endpoints = $o->endpoints; $endpoints->{update} = 'update.xml'; $endpoints->{service_request_updates} = 'update.xml'; $o->endpoints( $endpoints ); } - $self->suppress_alerts( $council->suppress_alerts ); - $self->system_user( $council->comment_user ); - $self->update_comments( $o, { areaid => $council->area_id }, ); + $self->suppress_alerts( $body->suppress_alerts ); + $self->system_user( $body->comment_user ); + $self->update_comments( $o, { areaid => $body->area_id }, ); } } @@ -83,7 +83,7 @@ sub update_comments { FixMyStreet::App->model('DB::Problem') ->search( { external_id => $request_id, - council => { like => '%' . $council_details->{areaid} . '%' }, + bodies_str => { like => '%' . $council_details->{areaid} . '%' }, } ); if (my $p = $problem->first) { |