selase
(Selase Krakani)
9월 12, 2025, 6:24오후
4
여기서 flag_reason가 생성되는 방식에 버그가 있는 것 같습니다:
def account_deleted(email, reviewable)
post_action_type_id =
reviewable.reviewable_scores.first&.reviewable_score_type ||
PostActionTypeView.new.types[:spam]
build_email(
email,
template: "user_notifications.account_deleted",
flag_reason: I18n.t("flag_reasons.#{PostActionTypeView.new.types[post_action_type_id]}"),
)
end
PostActionTypeView.new.types에는 :needs_approval 플래그(설명된 플로우에서 생성됨)가 포함되어 있지 않습니다. 이로 인해 번역 키가 접미사 없이 flag_reasons.로 해석되어, 단일 항목 대신 YAML 섹션 전체가 반환됩니다. 이것이 플래그 이유 자리에 Ruby 해시가 표시되는 이유입니다.
flag_reasons:
off_topic: "Your post was flagged as **off-topic**: the community feels it is not a good fit for the topic, as currently defined by the title and the first post."
inappropriate: "Your post was flagged as **inappropriate**: the community feels it is offensive, abusive, to be hateful conduct or a violation of [our community guidelines](%{base_path}/guidelines)."
illegal: "Your post was flagged as **illegal**: the community thinks it might be breaking the law."
spam: "Your post was flagged as **spam**: the community feels it is an advertisement, something that is overly promotional in nature instead of being useful or relevant to the topic as expected."
notify_moderators: "Your post was flagged **for moderator attention**: the community feels something about the post requires manual intervention by a staff member."
responder:
off_topic: "The post was flagged as **off-topic**: the community feels it is not a good fit for the topic, as currently defined by the title and the first post."
inappropriate: "The post was flagged as **inappropriate**: the community feels it is offensive, abusive, to be hateful conduct or a violation of [our community guidelines](%{base_path}/guidelines)."
spam: "The post was flagged as **spam**: the community feels it is an advertisement, something that is overly promotional in nature instead of being useful or relevant to the topic as expected."
notify_moderators: "The post was flagged **for moderator attention**: the community feels something about the post requires manual intervention by a staff member."
관련하여, 커스텀 플래그의 번역도 누락될 가능성이 높으므로 이 문제가 커스텀 플래그에도 영향을 미칠 것으로 보입니다.
7개의 좋아요