【发布时间】:2014-05-11 12:21:25
【问题描述】:
我有一个 Customer_ratings 模型,允许用户互相留下反馈。 Web 应用程序运行正常,并收集、存储和显示反馈。
本想进去通过rails控制台删除一些反馈,但是当我输入Customer_rating.all时,出现如下错误:
LoadError: Unable to autoload constant Customer_rating, expected /Users/myapps/app/models/customer_rating.rb to define it
同样,如果我输入 Customer_rating[0],我会得到:
RuntimeError: Circular dependency detected while autoloading constant Customer_rating
我在通过控制台访问其他表时没有这个问题。
什么可能导致问题,为什么这个错误不会阻止 Customer_ratings 通过网络应用程序正常工作?
【问题讨论】:
-
我在这里看到了几个问题。让我们在聊天chat.stackoverflow.com/rooms/48530/ror 上讨论这个问题
-
仅供参考,所有常量都必须是CamelCase——你应该调用
CustomerRating
标签: ruby-on-rails-4 associations autoload rails-console