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
と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