Skip to content

Instantly share code, notes, and snippets.

@marcusramberg
Created January 9, 2012 13:17
Show Gist options
  • Save marcusramberg/1582892 to your computer and use it in GitHub Desktop.
Save marcusramberg/1582892 to your computer and use it in GitHub Desktop.
sub friends_apps {
my ( $self, $friends, $page, $rows ) = @_;
return $self->search({
'person.screenname' => { -in => [map { $_->screenname} $friends->all] },
},
{ join => { iuses => 'person' },
distinct => 1,
order_by => 'MAX(iuses.timestamp) DESC',
}
)->at_page($page, $rows || 12);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment