remove hash from first column name
[MojoFacets.git] / lib / MojoFacets.pm
index 9146e2f..cf52bec 100644 (file)
@@ -30,10 +30,10 @@ sub save_action {
                        $path =~ s{/}{.}g;
                        $actions_path .= sprintf '%.4f%s', $time, $path;
 
-                       my $array = $params->params;
-                       if ( @$array ) {
-                               store $array, $actions_path;
-                               warn "SAVE $actions_path ", -s $actions_path, " bytes params = ", dump($array), $/;
+                       my $hash = $params->to_hash;
+                       if ( $hash ) {
+                               store $hash, $actions_path;
+                               warn "SAVE $actions_path ", -s $actions_path, " bytes params = ", dump($hash), $/;
                        }
                }
        }
@@ -51,13 +51,13 @@ sub startup {
 
 #      $self->plugin( 'request_timer' );
 
-       $self->plugins->add_hook(
+       $self->hook(
                        after_dispatch => sub {
                                my ($self) = @_;
                                save_action( $self );
                        }
        );
-       
+
        eval 'use MojoFacets::Plugin::NYTProf';
        if ( $@ ) {
                warn "profile disabled: ",substr($@,0,40) if $@;