aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorJosh Kalderimis <josh.kalderimis@gmail.com>2010-07-07 17:05:42 +0200
committerJosé Valim <jose.valim@gmail.com>2010-07-08 18:28:38 +0200
commit7c86e8e21ba6a1f88226ddd0cf012a563f234d06 (patch)
treeba1ebdeaed80dc86211c1bce56919c0d39a0bea2 /activerecord/test/models
parent606088df3f10dd8daec8ccc97d8279c119a503b5 (diff)
downloadrails-7c86e8e21ba6a1f88226ddd0cf012a563f234d06.tar.gz
rails-7c86e8e21ba6a1f88226ddd0cf012a563f234d06.tar.bz2
rails-7c86e8e21ba6a1f88226ddd0cf012a563f234d06.zip
minor changes to mass assignment security patch to bring it in line with rails standards
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/mass_assignment_specific.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/activerecord/test/models/mass_assignment_specific.rb b/activerecord/test/models/mass_assignment_specific.rb
new file mode 100644
index 0000000000..13a80e0197
--- /dev/null
+++ b/activerecord/test/models/mass_assignment_specific.rb
@@ -0,0 +1,32 @@
+class LoosePerson < ActiveRecord::Base
+ self.table_name = 'people'
+ self.abstract_class = true
+ attr_protected :credit_rating, :administrator
+end
+
+class LooseDescendant < LoosePerson
+ attr_protected :phone_number
+end
+
+class LooseDescendantSecond< LoosePerson
+ attr_protected :phone_number
+ attr_protected :name
+end
+
+class TightPerson < ActiveRecord::Base
+ self.table_name = 'people'
+ attr_accessible :name, :address
+end
+
+class TightDescendant < TightPerson
+ attr_accessible :phone_number
+end
+
+class Task < ActiveRecord::Base
+ attr_protected :starting
+end
+
+class TopicWithProtectedContent < ActiveRecord::Base
+ self.table_name = 'topics'
+ attr_protected :content
+end \ No newline at end of file