Skip to content

Commit

Permalink
Stop double-caching datetime_parser - keep it in the storage only
Browse files Browse the repository at this point in the history
  • Loading branch information
ribasushi committed Sep 4, 2009
1 parent 6c94a5c commit f568d83
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
9 changes: 1 addition & 8 deletions lib/DBIx/Class/InflateColumn/DateTime.pm
Expand Up @@ -86,8 +86,6 @@ For more help with using components, see L<DBIx::Class::Manual::Component/USING>

__PACKAGE__->load_components(qw/InflateColumn/);

__PACKAGE__->mk_group_accessors('simple' => '__datetime_parser');

=head2 register_column
Chains with the L<DBIx::Class::Row/register_column> method, and sets
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions lib/DBIx/Class/Serialize/Storable.pm
Expand Up @@ -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/;

Expand Down

0 comments on commit f568d83

Please sign in to comment.