diff options
author | Ernie Miller <ernie@metautonomo.us> | 2011-01-06 20:06:29 -0500 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-11 09:19:19 -0800 |
commit | 7d4d7457301faa85aa32b5ae29e13976e828954f (patch) | |
tree | 52695a0758fff2582736d08e672a3240b76b02f2 /activerecord/test/models | |
parent | a60ea742226f09dc566ad5d9a0b465c5d5db9687 (diff) | |
download | rails-7d4d7457301faa85aa32b5ae29e13976e828954f.tar.gz rails-7d4d7457301faa85aa32b5ae29e13976e828954f.tar.bz2 rails-7d4d7457301faa85aa32b5ae29e13976e828954f.zip |
Fix polymorphic belongs_to associationproxy raising errors when loading target.
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/sponsor.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/models/sponsor.rb b/activerecord/test/models/sponsor.rb index 7e5a1dc38b..aa4a3638fd 100644 --- a/activerecord/test/models/sponsor.rb +++ b/activerecord/test/models/sponsor.rb @@ -2,4 +2,6 @@ class Sponsor < ActiveRecord::Base belongs_to :sponsor_club, :class_name => "Club", :foreign_key => "club_id" belongs_to :sponsorable, :polymorphic => true belongs_to :thing, :polymorphic => true, :foreign_type => :sponsorable_type, :foreign_key => :sponsorable_id + belongs_to :sponsorable_with_conditions, :polymorphic => true, + :foreign_type => 'sponsorable_type', :foreign_key => 'sponsorable_id', :conditions => {:name => 'Ernie'} end |