diff options
author | Matthew Somerville <matthew@mysociety.org> | 2016-08-22 17:39:00 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-08-24 12:08:25 +0100 |
commit | b86cf12575fd42289803656743d40a1065150818 (patch) | |
tree | 7a615b98aacc7bd5d2d78725d28bc99c5df671da /perllib/FixMyStreet/DB/Result/Contact.pm | |
parent | 669fd23dbb7870fe20284f3e029a1fe6da09625b (diff) |
Automatically spot Open311 co-ord/ID attributes.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Contact.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Contact.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm index dab5432c6..58d8e58de 100644 --- a/perllib/FixMyStreet/DB/Result/Contact.pm +++ b/perllib/FixMyStreet/DB/Result/Contact.pm @@ -68,4 +68,15 @@ use namespace::clean -except => [ 'meta' ]; with 'FixMyStreet::Roles::Extra'; +sub get_metadata_for_input { + my $self = shift; + my $id_field = $self->id_field; + return [ grep { $_->{code} !~ /^(easting|northing|$id_field)$/ } @{$self->get_extra_fields} ]; +} + +sub id_field { + my $self = shift; + return $self->get_extra_metadata('id_field') || 'fixmystreet_id'; +} + 1; |