0

奇怪的错误,我正在调用::Facility::ProcedureDecorator,但由于某种原因,在我的登台服务器上,ruby 想要调用ProceduresDecorator。有什么想法吗?

以下是一些示例:

NameError: uninitialized constant #<Class:0x00555f1ea188d0>::ProceduresDecorator
Did you mean? Facility::ProcedureDecorator
File "/app/app/admin/facility.rb" line 32 in edit


def edit
  @facility = Facility.includes([:documents, :procedures]).find(params[:id])
  @facility_documents = @facility.documents
  @possible_document_kinds = FacilityDocument.kinds.map { |k, _| [k.humanize, k] }
  @facility_procedures = ::Facility::ProcedureDecorator
                         .decorate_collection(@facility.procedures) # line 32
  @facility_info = ::Facility::InfoDecorator.decorate(@facility.info)
  @possible_procedures = @facility_procedures.map { |procedure| [procedure.name, procedure.id] }
  @templates = @facility.emergency_event_templates
  @white_label = @facility.white_label
end

编辑:谢谢大家的帮助,最后问题在 内config/environments/staging.rb,这两行引起了问题。

config.cache_classes = true
config.eager_load = true
4

0 回答 0