diff options
author | Paul Gallagher <gallagher.paul@gmail.com> | 2011-06-19 10:21:15 +0800 |
---|---|---|
committer | Paul Gallagher <gallagher.paul@gmail.com> | 2011-06-19 10:21:15 +0800 |
commit | 2b3d67fdaf2c78a5447316a90c54c7c9c520c71a (patch) | |
tree | 19cf0443c671ddf015c12b85e7022a2bd428b9ba /activerecord/test/models/person.rb | |
parent | b0d59907f733841280095b16c98a95574b3a0938 (diff) | |
parent | 6c705e33ef78d28d5d964a03edc627f31d7f8c25 (diff) | |
download | rails-2b3d67fdaf2c78a5447316a90c54c7c9c520c71a.tar.gz rails-2b3d67fdaf2c78a5447316a90c54c7c9c520c71a.tar.bz2 rails-2b3d67fdaf2c78a5447316a90c54c7c9c520c71a.zip |
Merge remote branch 'rails/master' into pg_schema_fu
Diffstat (limited to 'activerecord/test/models/person.rb')
-rw-r--r-- | activerecord/test/models/person.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/test/models/person.rb b/activerecord/test/models/person.rb index a58c9bf572..967a3625aa 100644 --- a/activerecord/test/models/person.rb +++ b/activerecord/test/models/person.rb @@ -59,8 +59,9 @@ class LoosePerson < ActiveRecord::Base 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 + + accepts_nested_attributes_for :best_friend, :best_friend_of, :best_friends end class LooseDescendant < LoosePerson; end @@ -70,11 +71,14 @@ class TightPerson < ActiveRecord::Base 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 + + accepts_nested_attributes_for :best_friend, :best_friend_of, :best_friends end class TightDescendant < TightPerson; end
\ No newline at end of file |