EppO/rolify — pull request #206 by ryanaip (2013-12-12 18:24:48+00:00)
Title: Add select(:id) to active record 'in' query to avoid MySQL errors in Rails 4.0.2

When using the latest version of Rails, we saw errors like:

```sql
Mysql2::Error: Operand should contain 1 column(s):
SELECT `catalogs`.* FROM `catalogs`
INNER JOIN `roles` ON `roles`.resource_type = 'Catalog' AND
(`roles`.resource_id IS NULL OR `roles`.resource_id = `catalogs`.id)
WHERE (`roles`.name IN ('read_only') AND `roles`.resource_type = 'Catalog') AND
(`roles`.id IN (
SELECT `roles`.* FROM `roles`
INNER JOIN `users_roles` ON `roles`.`id` = `users_roles`.`role_id`
WHERE `users_roles`.`user_id` = 1 AND `roles`.`name` = 'read_only'
) AND ((resource_id = `catalogs`.id) OR (resource_id IS NULL)))
```

This is corrected by changing ```SELECT `roles`.* FROM `roles` ``` to ```SELECT `roles`.id FROM `roles` ``` in the subquery.