Permalink
Browse files

simplify session handling, add timestamp, refs #224

  • Loading branch information...
1 parent 990b1ce commit 70cdab7c6c79ee65e0406f2d2398c4c37c6f1a28 @monken monken committed Dec 24, 2012
Showing with 8 additions and 6 deletions.
  1. +0 −1 lib/Catalyst/Plugin/Session/Store/ElasticSearch.pm
  2. +8 −5 lib/MetaCPAN/Model/User/Session.pm
@@ -52,7 +52,6 @@ sub store_session_data {
index => $self->_session_es_index,
type => $self->_session_es_type,
id => $sid,
- parent => $session->{__user} || "",
data => $session,
refresh => 1,
);
@@ -1,13 +1,16 @@
package MetaCPAN::Model::User::Session;
use Moose;
use ElasticSearchX::Model::Document;
-use DateTime;
-has id => ( is => 'ro', id => 1 );
+=head2 timestamp
-has date =>
- ( is => 'ro', required => 1, isa => 'DateTime', default => sub { DateTime->now } );
+Sets the C<_timestamp> field.
-has account => ( parent => 1, is => 'rw', required => 1 );
+=cut
+
+has timestamp => (
+ is => 'ro',
+ timestamp => { store => 1 },
+);
__PACKAGE__->meta->make_immutable;

0 comments on commit 70cdab7

Please sign in to comment.