active_record_callbacks check for attachment