Changeset 1495

Show
Ignore:
Timestamp:
09/02/04 21:31:18
Author:
miyagawa
Message:

0.06: changed slice

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Class-DBI-Pager/trunk/Changes

    r974 r1495  
    11Revision history for Perl extension Class::DBI::Pager 
     2 
     30.06  Thu Sep  2 21:30:55 JST 2004 
     4        * Fixed problem with has_many() 
     5          (Thanks to Rhesa Rozendaal) 
    26 
    370.05  Wed Dec 17 15:45:35 JST 2003 
  • Class-DBI-Pager/trunk/MANIFEST

    r723 r1495  
    66t/00_compile.t 
    77t/01_pager.t 
     8META.yml                                 Module meta-data (added by MakeMaker) 
  • Class-DBI-Pager/trunk/lib/Class/DBI/Pager.pm

    r974 r1495  
    33use strict; 
    44use vars qw($VERSION $AUTOLOAD); 
    5 $VERSION = 0.05
     5$VERSION = 0.06
    66 
    77use Class::DBI 0.90; 
     
    5252            $iter->count, $self->{entry}, $self->{curr}, 
    5353        ); 
    54         my @data = ($iter->data)[$pager->first-1 .. $pager->last-1]; 
    55         return $self->{pkg}->_ids_to_objects(\@data); 
     54        return $iter->slice($pager->first-1, $pager->last-1); 
    5655    } 
    5756    else { 
  • Class-DBI-Pager/trunk/t/01_pager.t

    r738 r1495  
    55    eval "use DBD::SQLite"; 
    66    plan $@ ? (skip_all => 'needs DND::SQLite for testing') 
    7         : (tests => 36); 
     7        : (tests => 37); 
    88} 
    99 
     
    9494 
    9595    is $iterator->count, 11, "iterator counts 11"; 
     96 
     97    my @list = $pager->search_like(title => "title 1%"); 
     98    is scalar(@list), 11, "array context works"; 
    9699} 
    97100