【发布时间】:2011-10-05 12:47:23
【问题描述】:
我在 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 表。
如何为 acl9 实现 has_many :through 关联?这超出了我的范围,特别是因为 user 和 role 模型都只使用辅助方法,而没有实际的 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
【问题讨论】:
-
我在github页面上提出了一个问题。希望它会很快得到修复。 github.com/be9/acl9/issues/39
标签: ruby-on-rails-3 associations has-many-through acl9