Changeset 29873

Show
Ignore:
Timestamp:
02/10/09 23:56:38 (6 years ago)
Author:
walf443
Message:

added shortcut search('table') as Skinny->do('SELECT * FROM tabel'). It may useful get from small table.

Location:
lang/perl/DBIx-Skinny/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/DBIx-Skinny/trunk/lib/DBIx/Skinny.pm

    r29187 r29873  
    162162    ); 
    163163 
    164     $class->_add_where($rs, $where); 
     164    if ( $where ) { 
     165        $class->_add_where($rs, $where); 
     166    } 
    165167 
    166168    $rs->limit(   $opt->{limit}   ) if $opt->{limit}; 
  • lang/perl/DBIx-Skinny/trunk/t/111_search.t

    r27373 r29873  
    1616            name => 'perl', 
    1717        }); 
     18        Mock::Basic->insert('mock_basic',{ 
     19            id   => 2, 
     20            name => 'python', 
     21        }); 
    1822    }; 
    1923 
     
    2832        is $row->name, 'perl'; 
    2933    }; 
     34 
     35    test 'search without where' => run { 
     36        my $itr = Mock::Basic->search('mock_basic'); 
     37 
     38        my $row = $itr->next; 
     39        isa_ok $row, 'DBIx::Skinny::Row'; 
     40 
     41        is $row->id, 1; 
     42        is $row->name, 'perl'; 
     43 
     44        my $row2 = $itr->next; 
     45 
     46        isa_ok $row2, 'DBIx::Skinny::Row'; 
     47 
     48        is $row2->id, 2; 
     49        is $row2->name, 'python'; 
     50    }; 
    3051}; 
    3152