I have a question about using attr_accessible
in Rails.
I sometimes want to set guard_protected_attributes
to false
in order to bypass mass assignment protection. I'm wondering why the following line doesn't work (it creates the "can't stringify keys" error):
@user.attributes=({ :name => "James Bond", :admin => true }, false)
...but this does:
@user.send(:attributes=, { :name => "James Bond", :admin => true }, false)
Anyone know the reason?