- or download this
sub by_genre { $_[0]->search({ 'me.genre' => $_[1] });
sub since { $_[0]->search({ 'me.released' => { '>=', $_[1] } });
- or download this
my $rs = $schema->resultset('CD');
if ( my $genre = param->{'genre'} ) {
...
if ( my $since = param->{'since'} ) {
$rs = $rs->since( $since );
}
- or download this
if ( my $limit = param->{'limit'} ) {
$rs = $rs->limit_per_artist( $limit );
}