From d18a27031f8794b0134645eb0d62ec16653ac537 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Sat, 1 Jan 2011 18:23:06 +0000 Subject: [PATCH] Add documentation for the :foreign_type option on belongs_to --- activerecord/lib/active_record/associations.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 9a4f6d4dfd..0c71e76899 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1177,6 +1177,11 @@ module ActiveRecord # association will use "person_id" as the default :foreign_key. Similarly, # belongs_to :favorite_person, :class_name => "Person" will use a foreign key # of "favorite_person_id". + # [:foreign_type] + # Specify the column used to store the associated object's type, if this is a polymorphic + # association. By default this is guessed to be the name of the association with a "_type" + # suffix. So a class that defines a belongs_to :taggable, :polymorphic => true + # association will use "taggable_type" as the default :foreign_type. # [:primary_key] # Specify the method that returns the primary key of associated object used for the association. # By default this is id.