From: Peter Rabbitson Date: Fri, 4 Sep 2009 19:32:01 +0000 (+0000) Subject: Stop double-caching datetime_parser - keep it in the storage only X-Git-Tag: v0.08111~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f568d83bc887edbb5a7dbf36ee38150db3eb994a;p=dbsrgits%2FDBIx-Class.git Stop double-caching datetime_parser - keep it in the storage only --- diff --git a/lib/DBIx/Class/InflateColumn/DateTime.pm b/lib/DBIx/Class/InflateColumn/DateTime.pm index 35aa3e6..2b40608 100644 --- a/lib/DBIx/Class/InflateColumn/DateTime.pm +++ b/lib/DBIx/Class/InflateColumn/DateTime.pm @@ -86,8 +86,6 @@ For more help with using components, see L __PACKAGE__->load_components(qw/InflateColumn/); -__PACKAGE__->mk_group_accessors('simple' => '__datetime_parser'); - =head2 register_column Chains with the L method, and sets @@ -224,12 +222,7 @@ sub _deflate_from_datetime { } sub _datetime_parser { - my $self = shift; - if (my $parser = $self->__datetime_parser) { - return $parser; - } - my $parser = $self->result_source->storage->datetime_parser(@_); - return $self->__datetime_parser($parser); + shift->result_source->storage->datetime_parser (@_); } 1; diff --git a/lib/DBIx/Class/Serialize/Storable.pm b/lib/DBIx/Class/Serialize/Storable.pm index d165862..7cc1218 100644 --- a/lib/DBIx/Class/Serialize/Storable.pm +++ b/lib/DBIx/Class/Serialize/Storable.pm @@ -11,11 +11,6 @@ sub STORABLE_freeze { # reattached in the thaw handler below delete $to_serialize->{result_source}; - # If the parser is cached there is a chance that the interpeter - # which receives the ice will not have the parser loaded - # A re-determination will force an implicit load - delete $to_serialize->{__datetime_parser}; - # Dynamic values, easy to recalculate delete $to_serialize->{$_} for qw/related_resultsets _inflated_column/;