Active Admin 和 STI 模型错误:找不到表“类别”;
更新 #1:已解决! 不知何故,Pow 没有重新启动其进程,因此更新后它会加载旧的配置文件。它加载了错误的区域设置文件。
我删除了最近安装的 gem(仅从 Gemfile)并重新启动了 Pow。然后我将宝石一一添加回 Gemfile 中。 ActiveAdmin 和 Rails 本地化也开始正常工作。
原始问题:
我正在尝试设置 ActiveAdmin 来支持我的分类法。我的设置如下:
class Taxonomy < ActiveRecord::Base
end
class Category < Taxonomy
has_ancestry # implements a tree of categories
end
class Tag < Taxonomy
end
现在我将以下内容添加到 ActiveAdmin:
ActiveAdmin.register Category do
end
它返回以下错误:
Could not find table 'categories'
我的迁移肯定已运行。我在 taxonomies
表中有一些有效的 STI 记录。那么可能有什么问题呢?
Update #1: Solved! Somehow Pow did not restart it's processes, so after updates it was loading the old config files. And it was loading the wrong locale file.
I deleted gems I installed recently (only from Gemfile) and restarted Pow. Then one by one I added gems back to the Gemfile. As well ActiveAdmin as Rails localization started working normally.
Original question:
I am trying to setup ActiveAdmin to support my taxonomies. My setup is as following:
class Taxonomy < ActiveRecord::Base
end
class Category < Taxonomy
has_ancestry # implements a tree of categories
end
class Tag < Taxonomy
end
So now I added the following to ActiveAdmin:
ActiveAdmin.register Category do
end
And it returns the folioing error:
Could not find table 'categories'
My migrations were definitely ran. And I have some valid STI records in the taxonomies
table. So what can be wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论