Fix get_many_uids_for_class for Rails 4.1 and 4.2