0
我有我的应用程序评论模型与许多comment_types没有迁移的模型。 Rails的
class Comment < ActiveRecord::Base
belongs_to :comment_type, :polymorphic => true
end
我也有一个公共的质量保证体系。因此,对于每一对我有一个模型
class QA < ActiveRecord::Base
has_one :question, :class_name => :comment, :as => :comment_type, :autosave => true
has_one :asnwer, :class_name => :comment, :as => :comment_type, :autosave => true
end
,这似乎有点过度使用对我来说,有质量保证模式的特殊表。因为这个表应该只有ID键。那么有没有更好的解决方案?或者我的架构总共可能有问题?
[ActiveRecord :: Base Without Table]的可能重复(http://stackoverflow.com/questions/937429/activerecordbase-without-table) – Ximik 2012-02-08 20:01:27
好像我找到了解决方案。非常遗憾。 – Ximik 2012-02-08 20:02:04