我有一个包含两个文件的 Rails 文件夹:
app/hub_spot/client.rb:
module HubSpot
class Client
app/hub_spot/create_contact_form.rb:
module HubSpot
class CreateContactForm
当我运行 zeitwerk 检查时,我得到:
expected file app/hub_spot/client.rb to define constant Client, but didn't
如果我添加:
config.autoload_paths << Rails.root.join("app/hub_spot")
config.eager_load_paths << Rails.root.join("app/hub_spot")
然后我收到一个新的错误:
expected file app/hub_spot/create_contact_form.rb to define constant CreateContactForm, but didn't
它似乎对这两个文件的抱怨不同?有什么方法可以告诉 Zeitwerk 查看文件夹中的模块名称吗?