取消与继承的 STI 模型的关联
cancel association for inhereted STI model
我在名为 User 的 STI 父模型中设置了一个 has_many 关联,从 User 继承的模型是 Group,我不希望 Group 具有 has_many 关联,是有办法吗?
以下应该有效:
class User < ActiveRecord::Base
has_many :relations
end
class Group < User
undef :relations
end
我在名为 User 的 STI 父模型中设置了一个 has_many 关联,从 User 继承的模型是 Group,我不希望 Group 具有 has_many 关联,是有办法吗?
以下应该有效:
class User < ActiveRecord::Base
has_many :relations
end
class Group < User
undef :relations
end