aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-09-20 11:47:32 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-09-20 12:18:59 -0500
commit1e56f1f14c7b033a6d180514c83e61193812fede (patch)
treecf0aea3f176016a444c81e3f79bc0982608de7f1
parent00da7c605dc99fd9bcc714e836308becd842a9d1 (diff)
downloadrails-1e56f1f14c7b033a6d180514c83e61193812fede.tar.gz
rails-1e56f1f14c7b033a6d180514c83e61193812fede.tar.bz2
rails-1e56f1f14c7b033a6d180514c83e61193812fede.zip
update AMo::ForbiddenAttributesError documentation [ci skip]
-rw-r--r--activemodel/lib/active_model/forbidden_attributes_protection.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/forbidden_attributes_protection.rb b/activemodel/lib/active_model/forbidden_attributes_protection.rb
index a5e4c4f650..f4c5d536eb 100644
--- a/activemodel/lib/active_model/forbidden_attributes_protection.rb
+++ b/activemodel/lib/active_model/forbidden_attributes_protection.rb
@@ -1,4 +1,16 @@
module ActiveModel
+ # Raised when forbidden attributes are used for mass assignment.
+ #
+ # class Person < ActiveRecord::Base
+ # end
+ #
+ # params = ActionController::Parameters.new(name: 'Bob')
+ # Person.new(params)
+ # # => ActiveModel::ForbiddenAttributesError
+ #
+ # params.permit!
+ # Person.new(params)
+ # # => #<Person id: nil, name: "Bob">
class ForbiddenAttributesError < StandardError
end