I got the following deprecation warning on the rails console:
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.
The issue lies with the roles_users table that I created following an online step-by-step tutorial.
How do I implement a has_many :through association for acl9? It's beyond me, especially since the user and role models each only use helper methods and no actual has_and_belongs_to_many.
This is how they look like:
class User < ActiveRecord::Base
acts_as_authentic
acts_as_authorization_subject :association_name => :roles
end
class Role < ActiveRecord::Base
acts_as_authorization_role
end
The answer was later discussed in the comments to this GitHub issue.
User model:
acts_as_authorization_subject :association_name => :roles, :join_table_name => :roles_users
Role model:
acts_as_authorization_role :join_table_name => :roles_users
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With