ZeusWPI/FK-enrolment — pull request #32 by Silox (2014-09-16 11:53:21+00:00)
Title: Fix the member_for_ugent_nr method (updates #23)

This changes:
```
2.1.1 :155 > Member.joins(:cards).select('members.*, COUNT(cards.id) as card_count').where(:ugent_nr => ugent_nr, :club_id => club.id).order('card_count DESC, updated_at DESC')
Member Load (1.1ms) SELECT members.*, COUNT(cards.id) as card_count FROM `members` INNER JOIN `cards` ON `cards`.`member_id` = `members`.`id` WHERE `members`.`ugent_nr` = '00803637' AND `members`.`club_id` = 26 ORDER BY card_count DESC, updated_at DESC
```
To:
```
2.1.1 :154 > Member.joins(:cards).select('members.*, COUNT(cards.id) as card_count').group(:member_id).where(:ugent_nr => ugent_nr, :club_id => club.id).order('card_count DESC, updated_at DESC')
Member Load (1.2ms) SELECT members.*, COUNT(cards.id) as card_count FROM `members` INNER JOIN `cards` ON `cards`.`member_id` = `members`.`id` WHERE `members`.`ugent_nr` = '00803637' AND `members`.`club_id` = 26 GROUP BY member_id ORDER BY card_count DESC, updated_at DESC
```