You’re using attr_accessible on your User model, to which you also want to audit changes using acts_as_audited. Unfortunately it blows up with “Declare either attr_protected or attr_accessible for User, but not both.” The problem is that acts_as_audited is adding its own attr_protected. We can patch it in acts_as_audited.rb line 71 (as of this writing). Change:
attr_protected :audit_ids
to
attr_protected :audit_ids if accessible_attributes.nil?
P.S. I would have commented directly on the acts_as_audited site in hopes of helping more people find this, but it appears that they’ve disabled comments. Bummer.
August 3, 2008 at 6:17 am |
Timothy,
Just so happens that I committed a fix for this yesterday (http://github.com/collectiveidea/acts_as_audited/commit/a799f388) and then came across your post, so I updated it to use accessible_attributes (http://github.com/collectiveidea/acts_as_audited/commit/b0c79ea4). Thanks!
August 22, 2008 at 12:51 pm |
Great!
I was wondering what could be causing this weird error message!