diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-01-01 18:18:54 +0000 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-03 16:24:30 -0800 |
commit | 16065b4f19b77111b7fec343969bcf98635e7e27 (patch) | |
tree | 6b6c9e642d9b97d262c691c3a5ae8a5edb043dfa /activerecord/test/models | |
parent | 60cf65def805995bcca184c40b44bb01d86a48aa (diff) | |
download | rails-16065b4f19b77111b7fec343969bcf98635e7e27.tar.gz rails-16065b4f19b77111b7fec343969bcf98635e7e27.tar.bz2 rails-16065b4f19b77111b7fec343969bcf98635e7e27.zip |
Some basic tests for the :foreign_type option on belongs_to, which was previously completely untested.
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/sponsor.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/test/models/sponsor.rb b/activerecord/test/models/sponsor.rb index 50c2c2d76c..7e5a1dc38b 100644 --- a/activerecord/test/models/sponsor.rb +++ b/activerecord/test/models/sponsor.rb @@ -1,4 +1,5 @@ class Sponsor < ActiveRecord::Base belongs_to :sponsor_club, :class_name => "Club", :foreign_key => "club_id" belongs_to :sponsorable, :polymorphic => true -end
\ No newline at end of file + belongs_to :thing, :polymorphic => true, :foreign_type => :sponsorable_type, :foreign_key => :sponsorable_id +end |