Skip to content

Instantly share code, notes, and snippets.

@ocharles
Created January 25, 2009 05:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ocharles/51696 to your computer and use it in GitHub Desktop.
Save ocharles/51696 to your computer and use it in GitHub Desktop.
sub by_artist {
my ($self, $artist) = @_;
$self->search(
{ 'names.artist' => $artist->id },
{
join => [
{ artist => 'names' },
'name'
],
'+select' => [ 'name.name' ],
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment