From 075c81feec87b1e5bfec27ed585c4ab613c2d174 Mon Sep 17 00:00:00 2001 From: Ulisses Almeida + Kassio Borges Date: Mon, 8 Dec 2014 17:43:16 -0200 Subject: Add foreign_type option for polymorphic has_one and has_many. To be possible to use a custom column name to save/read the polymorphic associated type in a has_many or has_one polymorphic association, now users can use the option :foreign_type to inform in what column the associated object type will be saved. --- activerecord/test/schema/schema.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/test/schema') diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb index 720a127585..a9c2b1d112 100644 --- a/activerecord/test/schema/schema.rb +++ b/activerecord/test/schema/schema.rb @@ -595,6 +595,11 @@ ActiveRecord::Schema.define do t.string :title, null: false end + create_table :images, force: true do |t| + t.integer :imageable_identifier + t.string :imageable_class + end + create_table :price_estimates, force: true do |t| t.string :estimate_of_type t.integer :estimate_of_id -- cgit v1.2.3