diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-07-15 10:07:38 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-07-15 10:07:38 +0100 |
commit | 6e0d2f66af0da08f6748cbfafeeaaa26c5ff076c (patch) | |
tree | 5e7b03333daec4c4c7d9d42426c9a223d1c944a4 /perllib/FixMyStreet/DB | |
parent | a84edcaa42fc46f238d370bc453a242c83db6221 (diff) | |
parent | ab3799ad3e5147f80a60435dfa720eb71eaef8bf (diff) |
Merge branch '1456-do-not-store-display-only-attributes'
Diffstat (limited to 'perllib/FixMyStreet/DB')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Contact.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm index 17620f279..3ce0ec66f 100644 --- a/perllib/FixMyStreet/DB/Result/Contact.pm +++ b/perllib/FixMyStreet/DB/Result/Contact.pm @@ -121,6 +121,16 @@ sub get_metadata_for_input { return \@metadata; } +sub get_metadata_for_storage { + my $self = shift; + my $metadata = $self->get_metadata_for_input; + + # Also ignore any that were only for textual display + my @metadata = grep { ($_->{variable} || '') ne 'false' } @$metadata; + + return \@metadata; +} + sub id_field { my $self = shift; return $self->get_extra_metadata('id_field') || 'fixmystreet_id'; |