Here's is one solution.
current_user_id = current_user.idPhoto.select(%q{ user_id, COUNT(*) no_photos, date_trunc('day', created_at::timestamp) as what_day}).group("what_day, user_id").order("what_day DESC").where(%Q{ user_id IN ( (SELECT followable_id FROM follows where follower_id = #{current_user_id}) UNION ALL (SELECT #{current_user_id} as followable_id) )})
date_trunc
truncates the date to a specified precision, in this case the beginning of a day. I'm not sure what follows.followable_type
does in your case, but the above should work.