我在 Rails 控制台上收到以下弃用警告:
DEPRECATION WARNING: Having additional attributes on the join table of a
has_and_belongs_to_many association is deprecated and will be removed in Rails 3.1.
Please use a has_many :through association instead.
问题在于roles_users
我按照在线分步教程创建的表。
如何has_many :through
为 acl9 实现关联?这超出了我的范围,特别是因为user
androle
模型每个都只使用辅助方法而没有实际has_and_belongs_to_many
的 .
它们是这样的:
class User < ActiveRecord::Base
acts_as_authentic
acts_as_authorization_subject :association_name => :roles
end
class Role < ActiveRecord::Base
acts_as_authorization_role
end