diff options
author | Ulisses Almeida + Kassio Borges <anizark+kassioborgesm@gmail.com> | 2014-12-08 17:43:16 -0200 |
---|---|---|
committer | Ulisses Almeida + Kassio Borges <anizark+kassioborgesm@gmail.com> | 2014-12-08 18:13:15 -0200 |
commit | 075c81feec87b1e5bfec27ed585c4ab613c2d174 (patch) | |
tree | 2fad903219acd89c1437d83c9b7737da3b14292e /activerecord/test/schema | |
parent | 7daeb98c769a3968a2ccf48ff593909bf1a9d7b0 (diff) | |
download | rails-075c81feec87b1e5bfec27ed585c4ab613c2d174.tar.gz rails-075c81feec87b1e5bfec27ed585c4ab613c2d174.tar.bz2 rails-075c81feec87b1e5bfec27ed585c4ab613c2d174.zip |
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.
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r-- | activerecord/test/schema/schema.rb | 5 |
1 files changed, 5 insertions, 0 deletions
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 |