Made association logic also work for non-standard association names (e.g. when using the :class_name option)