텍스트 유형 사용자 지정 필드 값을 검증하는 플러그인

I know for sure that this piece of code is what causes the 500 Internal Server Error:

Is there anybody out there who can tell me how to get at the user field value of a custom field?

Other peices poeces of code that aren’t workijg either:

custom_field_value = self.user.reload.custom_fields[custom_field_key]
custom_field_value = UserCustomField.where(user_id: self.user.id, name: custom_field_key).pluck(:value).first

Any ideas / pointers to documentation pr code?