Access denied, Please sign in and make sure you have proper permission.
例如
提案--用户组--用户这样的三层关系
其中提案 - 用户组和用户组 - 用户都是多对多
如何建立提案和用户间的关系?
class 提案 < ActiveRecord::Base
has_many :用户组
has_many :用户, through: :用户组
end
class 用户组 < ActiveRecord::Base
has_many :用户
end
#3 楼 @suupic has_and_belongs_to_many 性能相当的坑人,数据上百以后经常会出现 cpu 假死。我现在是用 array 搞的,不知道各位道友有没有其他的方案。