diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-06-21 17:28:24 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-06-21 17:28:24 +0100 |
commit | bbeb8db833e20bf956bd04700f7c6123e942c92d (patch) | |
tree | 23aaa704fc74228de5ebf46f63cf101c82fe6e8c /perllib/FixMyStreet/DB/Result/User.pm | |
parent | acaa7ebf2ebb6f25956fe6045fadbd8772e2d8ae (diff) | |
parent | 63f8ca8d3fe1e3b52e079e41b29c85d14376f261 (diff) |
Merge branch '2166-comma-category'
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/User.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/User.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm index 8b539f85d..5ba597f74 100644 --- a/perllib/FixMyStreet/DB/Result/User.pm +++ b/perllib/FixMyStreet/DB/Result/User.pm @@ -131,6 +131,7 @@ __PACKAGE__->load_components("+FixMyStreet::DB::RABXColumn"); __PACKAGE__->rabx_column('extra'); use Moo; +use Text::CSV; use FixMyStreet::SMS; use mySociety::EmailUtil; use namespace::clean -except => [ 'meta' ]; @@ -544,6 +545,17 @@ has categories => ( }, ); +has categories_string => ( + is => 'ro', + lazy => 1, + default => sub { + my $self = shift; + my $csv = Text::CSV->new; + $csv->combine(@{$self->categories}); + return $csv->string; + }, +); + sub set_last_active { my $self = shift; my $time = shift; |