Skip to content

Instantly share code, notes, and snippets.

@rizen
Created June 20, 2013 21:20
Show Gist options
  • Save rizen/5826749 to your computer and use it in GitHub Desktop.
Save rizen/5826749 to your computer and use it in GitHub Desktop.
what happened
The contestentries table has a 1:1 relationship with games table via a foreign key called game_id in the contestentries table.
This works:
$db->resultset('ContestEntry')->search(undef,{order_by => [{ -desc => 'crafter_points'}, { -asc => 'me.date_created' }]});
This results in the "game" relationships being undef:
$db->resultset('ContestEntry')->search(undef,{order_by => [{ -desc => 'crafter_points'}, { -asc => 'me.date_created' }], prefetch => 'game'});
@ribasushi
Copy link

Just in case you didn't see my tweet-ply for some reason: https://twitter.com/ribasushi/status/347832508710256641

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment