Apply version 1.0.1 from CPAN.
[dbsrgits/DBIx-Class-Cursor-Cached.git] / lib / DBIx / Class / Cursor / Cached.pm
index b27ed81..5eaf6b0 100644 (file)
@@ -6,6 +6,10 @@ use 5.6.1;
 use Storable ();
 use Digest::SHA1 ();
 
+use vars qw($VERSION);
+
+$VERSION = '1.000001';
+
 sub new {
   my $class = shift;
   my ($storage, $args, $attrs) = @_;
@@ -30,7 +34,7 @@ sub new {
 
 sub next {
   my ($self) = @_;
-  return @{($self->{data} ||= $self->_fill_data)->{$self->{pos}++}||[]};
+  return @{($self->{data} ||= $self->_fill_data)->[$self->{pos}++]||[]};
 }
 
 sub all {
@@ -64,6 +68,8 @@ sub clear_cache {
   delete $self->{data};
 }
 
+sub cache_key { shift->{cache_key} }
+
 1;
 
 =head1 NAME