diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-04-25 10:53:39 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-05-02 22:09:30 +0100 |
commit | 1edb407cddcd26fda53066c8cc92e8e04ad003b9 (patch) | |
tree | 8bff0c223a9e5b3517dd1dcdd4235bbd27614fda /perllib/FixMyStreet/DB/Result/Questionnaire.pm | |
parent | 54cad1e4d2474fba55485731ca9e2fd1779c524a (diff) |
Refactor datetime inflation.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Questionnaire.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Questionnaire.pm | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Questionnaire.pm b/perllib/FixMyStreet/DB/Result/Questionnaire.pm index 6b7ab9452..846514fe8 100644 --- a/perllib/FixMyStreet/DB/Result/Questionnaire.pm +++ b/perllib/FixMyStreet/DB/Result/Questionnaire.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("questionnaire"); __PACKAGE__->add_columns( "id", @@ -40,23 +44,12 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 17:11:54 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oL1Hk4/bNG14CY74GA75SA +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dmTa+1kr1wB1PMSTQo3HBw use Moo; use namespace::clean -except => [ 'meta' ]; -my $stz = sub { - my ( $orig, $self ) = ( shift, shift ); - my $s = $self->$orig(@_); - return $s unless $s && UNIVERSAL::isa($s, "DateTime"); - FixMyStreet->set_time_zone($s); - return $s; -}; - -around whensent => $stz; -around whenanswered => $stz; - sub marks_fixed { my $self = shift; my $new_fixed = FixMyStreet::DB::Result::Problem->fixed_states()->{$self->new_state}; |