I have a question about using attr_accessiblein Rails.
I sometimes want to set guard_protected_attributesto falseto get around the mass assignment protection. I am wondering why the following line does not work (it creates the error "can not stringify keys"):
@user.attributes=({ :name => "James Bond", :admin => true }, false)
... but it does:
@user.send(:attributes=, { :name => "James Bond", :admin => true }, false)
Does anyone know the reason?
source
share