I’m having and issue with a many to many relationship. This is my
I have a user model, a role model and a role_user model.
Looks something like this:
class User < ActiveRecord::Base
acts_as_audited :protect => false
has_many :roles, :through => :role_users
class Role < ActiveRecord::Base
has_many :users, :through => :role_users
class RoleUser < ActiveRecord::Base
In the user edit form I show one checkbox for each role in order to
remove roles to a user. I would like this changes to be auditable.
Right now when I check a checkbox and save a new record appears in the
audits table, since a record had been inserted in role_users, but
happend when I uncheck a role and save (a record is being deleted from
It will be great if this could be part of a User change instead of a
RoleUser, since it will be a new version of the user, but this is not
a must. More like a nice to have.
Thanks to all in advance and sorry to bother with this newbie question.