aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/person.rb
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2012-07-17 02:34:57 -0500
committerGuillermo Iguaran <guilleiguaran@gmail.com>2012-09-16 23:58:19 -0500
commit8020f71df120f80fd7db9ab568c8d0d6d1ad4e28 (patch)
tree5e6fa3226871f385f0a154d566ddaf0b713f49a4 /activerecord/test/models/person.rb
parentf8c9a4d3e88181cee644f91e1342bfe896ca64c6 (diff)
downloadrails-8020f71df120f80fd7db9ab568c8d0d6d1ad4e28.tar.gz
rails-8020f71df120f80fd7db9ab568c8d0d6d1ad4e28.tar.bz2
rails-8020f71df120f80fd7db9ab568c8d0d6d1ad4e28.zip
Remove mass assignment security from ActiveRecord
Diffstat (limited to 'activerecord/test/models/person.rb')
-rw-r--r--activerecord/test/models/person.rb12
1 files changed, 0 insertions, 12 deletions
diff --git a/activerecord/test/models/person.rb b/activerecord/test/models/person.rb
index 6e6ff29f77..6ad0cf6987 100644
--- a/activerecord/test/models/person.rb
+++ b/activerecord/test/models/person.rb
@@ -59,9 +59,6 @@ class LoosePerson < ActiveRecord::Base
self.table_name = 'people'
self.abstract_class = true
- attr_protected :comments, :best_friend_id, :best_friend_of_id
- attr_protected :as => :admin
-
has_one :best_friend, :class_name => 'LoosePerson', :foreign_key => :best_friend_id
belongs_to :best_friend_of, :class_name => 'LoosePerson', :foreign_key => :best_friend_of_id
has_many :best_friends, :class_name => 'LoosePerson', :foreign_key => :best_friend_id
@@ -74,11 +71,6 @@ class LooseDescendant < LoosePerson; end
class TightPerson < ActiveRecord::Base
self.table_name = 'people'
- attr_accessible :first_name, :gender
- attr_accessible :first_name, :gender, :comments, :as => :admin
- attr_accessible :best_friend_attributes, :best_friend_of_attributes, :best_friends_attributes
- attr_accessible :best_friend_attributes, :best_friend_of_attributes, :best_friends_attributes, :as => :admin
-
has_one :best_friend, :class_name => 'TightPerson', :foreign_key => :best_friend_id
belongs_to :best_friend_of, :class_name => 'TightPerson', :foreign_key => :best_friend_of_id
has_many :best_friends, :class_name => 'TightPerson', :foreign_key => :best_friend_id
@@ -97,10 +89,6 @@ end
class NestedPerson < ActiveRecord::Base
self.table_name = 'people'
- attr_accessible :first_name, :best_friend_first_name, :best_friend_attributes
- attr_accessible :first_name, :gender, :comments, :as => :admin
- attr_accessible :best_friend_attributes, :best_friend_first_name, :as => :admin
-
has_one :best_friend, :class_name => 'NestedPerson', :foreign_key => :best_friend_id
accepts_nested_attributes_for :best_friend, :update_only => true