rails / protected_attributes

Protect attributes from mass-assignment in ActiveRecord models.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ActiveRecord::Base#update not supported

mrkamel opened this issue · comments

ActiveRecord's #update_attributes is only an alias for #update, http://apidock.com/rails/ActiveRecord/Persistence/update_attributes

However, protected_attributes doesn't monkey patch the #update method.

MyModel.first.update({:protected_attribute => "foobar"}, :without_protection => true)
=> ArgumentError: wrong number of arguments (2 for 1)

IMHO, #update should be supported by protected_attributes as well