I have a model that uses attr_accessible, and in my tests I get this:
RuntimeError (Declare either attr_protected or attr_accessible for
User, but not both.):
remove_attributes_protected_from_mass_assignment' /var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ base.rb:2114:inattributes=’
The model doesnt use attr_protected. It turns out that
User.protected_attributes is returning an empty set instead of nil,
which is what remove_attributes_protected_from_mass_assignment wants.
The real fun part is that this only happens in tests (rake
test:functional or ruby ./user_controller_test.rb). And for a real
kick in the crotch, I’ve seen it in development but only once in about
Anyone ever seen this?