diff options
author | Jon Leighton <j@jonathanleighton.com> | 2013-06-09 01:58:42 -0700 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2013-06-09 01:58:42 -0700 |
commit | ae6e6d953084d1966e52cc06ffe24131f0115cc1 (patch) | |
tree | 67f5b924096f4733980bab74c43ab92e437bca36 /activerecord/test/models | |
parent | 8b82387c97e60faff77c3db30e53abf2f94450d0 (diff) | |
parent | d6b03a376787ec9c9e934e5688a38c576f2e39b7 (diff) | |
download | rails-ae6e6d953084d1966e52cc06ffe24131f0115cc1.tar.gz rails-ae6e6d953084d1966e52cc06ffe24131f0115cc1.tar.bz2 rails-ae6e6d953084d1966e52cc06ffe24131f0115cc1.zip |
Merge pull request #10886 from wangjohn/chnges_for_automatic_inverse_associations
Documentation and cleanup of automatic discovery of inverse associations
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/club.rb | 2 | ||||
-rw-r--r-- | activerecord/test/models/interest.rb | 2 | ||||
-rw-r--r-- | activerecord/test/models/man.rb | 2 | ||||
-rw-r--r-- | activerecord/test/models/member.rb | 2 | ||||
-rw-r--r-- | activerecord/test/models/member_detail.rb | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/test/models/club.rb b/activerecord/test/models/club.rb index 7d7c205041..816c5e6937 100644 --- a/activerecord/test/models/club.rb +++ b/activerecord/test/models/club.rb @@ -1,6 +1,6 @@ class Club < ActiveRecord::Base has_one :membership - has_many :memberships, :automatic_inverse_of => false + has_many :memberships, :inverse_of => false has_many :members, :through => :memberships has_many :current_memberships has_one :sponsor diff --git a/activerecord/test/models/interest.rb b/activerecord/test/models/interest.rb index f772bb1c7f..d5d9226204 100644 --- a/activerecord/test/models/interest.rb +++ b/activerecord/test/models/interest.rb @@ -1,5 +1,5 @@ class Interest < ActiveRecord::Base - belongs_to :man, :inverse_of => :interests, :automatic_inverse_of => false + belongs_to :man, :inverse_of => :interests belongs_to :polymorphic_man, :polymorphic => true, :inverse_of => :polymorphic_interests belongs_to :zine, :inverse_of => :interests end diff --git a/activerecord/test/models/man.rb b/activerecord/test/models/man.rb index 49f002aa9a..4bff92dc98 100644 --- a/activerecord/test/models/man.rb +++ b/activerecord/test/models/man.rb @@ -1,7 +1,7 @@ class Man < ActiveRecord::Base has_one :face, :inverse_of => :man has_one :polymorphic_face, :class_name => 'Face', :as => :polymorphic_man, :inverse_of => :polymorphic_man - has_many :interests, :inverse_of => :man, :automatic_inverse_of => false + has_many :interests, :inverse_of => :man has_many :polymorphic_interests, :class_name => 'Interest', :as => :polymorphic_man, :inverse_of => :polymorphic_man # These are "broken" inverse_of associations for the purposes of testing has_one :dirty_face, :class_name => 'Face', :inverse_of => :dirty_man diff --git a/activerecord/test/models/member.rb b/activerecord/test/models/member.rb index b81304b8e0..cc47c7bc18 100644 --- a/activerecord/test/models/member.rb +++ b/activerecord/test/models/member.rb @@ -9,7 +9,7 @@ class Member < ActiveRecord::Base has_one :hairy_club, -> { where :clubs => {:name => "Moustache and Eyebrow Fancier Club"} }, :through => :membership, :source => :club has_one :sponsor, :as => :sponsorable has_one :sponsor_club, :through => :sponsor - has_one :member_detail, :automatic_inverse_of => false + has_one :member_detail, :inverse_of => false has_one :organization, :through => :member_detail belongs_to :member_type diff --git a/activerecord/test/models/member_detail.rb b/activerecord/test/models/member_detail.rb index a256c73c7e..9d253aa126 100644 --- a/activerecord/test/models/member_detail.rb +++ b/activerecord/test/models/member_detail.rb @@ -1,5 +1,5 @@ class MemberDetail < ActiveRecord::Base - belongs_to :member, :automatic_inverse_of => false + belongs_to :member, :inverse_of => false belongs_to :organization has_one :member_type, :through => :member |