aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/man.rb
diff options
context:
space:
mode:
authorAndrew S. Brown <andrew@dontfidget.com>2014-05-26 11:52:46 -0700
committerAndrew S. Brown <andrew@dontfidget.com>2014-06-10 21:46:12 -0700
commit9feadc11a71b655dd7748c0f3a92bc411c9e63c2 (patch)
treef092bdda0e4ff4fd375557e2afe3a2169e121a79 /activerecord/test/models/man.rb
parentd075c84320fab51992a1ab7d020c62ff1bad0b4e (diff)
downloadrails-9feadc11a71b655dd7748c0f3a92bc411c9e63c2.tar.gz
rails-9feadc11a71b655dd7748c0f3a92bc411c9e63c2.tar.bz2
rails-9feadc11a71b655dd7748c0f3a92bc411c9e63c2.zip
use name specified by 'as' for automatic inverse association to avoid reflecting on wrong association
Diffstat (limited to 'activerecord/test/models/man.rb')
-rw-r--r--activerecord/test/models/man.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/models/man.rb b/activerecord/test/models/man.rb
index f4d127730c..a26491ce61 100644
--- a/activerecord/test/models/man.rb
+++ b/activerecord/test/models/man.rb
@@ -1,6 +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_one :polymorphic_face_without_inverse, :class_name => 'Face', :as => :polymorphic_man_without_inverse
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