README.textile in sudo_attributes-0.4.0 vs README.textile in sudo_attributes-0.5.0
- old
+ new
@@ -22,10 +22,13 @@
<pre>
class User < ActiveRecord::Base
sudo_attr_protected :admin
end
+
+user = User.find(params[:id])
+user.sudo_update_attributes(params[:user])
</pre>
h2. Class Methods
The class methods *sudo_attr_protected* and *sudo_attr_accessible* will be available to all ActiveRecord models. When called, it adds numerous 'sudo' methods to the class. You may still use the default methods @attr_protected@ or @attr_accessible@ provided by rails, but you must still call @has_sudo_attributes@ in order to gain access to the sudo methods.
@@ -49,9 +52,10 @@
h2. Instance Methods
The following instance method is available to any ActiveRecord model that calls @has_sudo_attributes@
* @sudo_update_attributes@ - Uses identical syntax to @update_attributes@, but overrides protected attributes.
+* @sudo_update_attributes!@ - Same as sudo_update_attributes, but raises ActiveRecord errors. Same as @update_attributes!@
h2. Examples
**Protect an admin boolean attribute**