모델 테이블에서 열을 제거한 후 PaperTrail 버전을 수정하려고 할 때 문제가 발생합니다. private method 'warn' called for nil:NilClass
PaperTrail 로거는 어떻게 설정합니까?
을하고 reify
방법의 내부의 다음 줄에 나 포인트 :
스택 트레이스가 시작
나는 테이블에서 열을 제거했기 때문에# Set all the attributes in this version on the model.
attrs.each do |k, v|
if model.has_attribute?(k)
model[k.to_sym] = v
elsif model.respond_to?("#{k}=")
model.send("#{k}=", v)
else
logger.warn "Attribute #{k} does not exist on #{item_type} (Version id: #{id})."
end
end
, 내가 else
블록에 착륙하고있다 논리 트리가 완벽하게 합리적인 것처럼 보입니다.
그러나 나는 왜 logger
이 nil
인지 이해하지 못합니다. PaperTrail 로거를 어디서 어떻게 설정할 수 있습니까? 그러면 응용 프로그램이 충돌하지 않고 단순히 동작을 기록 할 수 있습니까?