ниже мой sql запрос
SELECT individuals.* FROM ( select children.* FROM checkins, children WHERE
checkins.child_id = children.id AND checkins.event_id = 1234 ) temp,
individuals WHERE temp.individual_id = individuals.id
ORDER BY individuals.firstname;
некоторые могут преобразовать это в совместимые с rails 2.3.5 (метод поиска активной записи)
[редактировать]
SELECT individuals.* FROM ( SELECT children.*
FROM checkins INNER JOIN children
ON checkins.child_id = children.id WHERE checkins.event_id = 1234 ) temp
INNER JOIN individuals ON temp.individual_id = individuals.id ORDER BY
individuals.firstname;