Skip to content

Commit

Permalink
Added title sort for tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Jan 15, 2017
1 parent b5604a8 commit f90c7e7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/Cooking/Schema/ResultSet/Track.pm
@@ -0,0 +1,23 @@
package Cooking::Schema::ResultSet::Track;

use strict;
use warnings;

use Moose;
use MooseX::NonMoose;
extends 'DBIx::Class::ResultSet';

sub BUILDARGS { $_[2] }

sub by_title {
my $self = shift;

return $self->search({}, {
join => 'song',
order_by => 'song.title',
});
}

__PACKAGE__->meta->make_immutable;

1;

0 comments on commit f90c7e7

Please sign in to comment.