aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-02-26 05:15:22 +0900
committerGitHub <noreply@github.com>2018-02-26 05:15:22 +0900
commit91b30a001b79096b60d9424a4664a417dce0b767 (patch)
treeef0ce40e074e30e4674a4b4c0f776bbc9a444c36 /activerecord/test/schema
parent8ff70cad3d634da344d741c49304a69572cbe188 (diff)
parent1af039dd3dfd68f40dc37b9a75b0d8a3dc8b1efe (diff)
downloadrails-91b30a001b79096b60d9424a4664a417dce0b767.tar.gz
rails-91b30a001b79096b60d9424a4664a417dce0b767.tar.bz2
rails-91b30a001b79096b60d9424a4664a417dce0b767.zip
Merge pull request #31895 from kamipo/do_not_attempt_to_find_inverse_of_polymorphic
Make `reflection.klass` raise if `polymorphic?` not to be misused
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r--activerecord/test/schema/schema.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index 7d008eecd5..3f4fe16678 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -814,6 +814,7 @@ ActiveRecord::Schema.define do
create_table :sponsors, force: true do |t|
t.integer :club_id
t.references :sponsorable, polymorphic: true, index: false
+ t.references :sponsor, polymorphic: true, index: false
end
create_table :string_key_objects, id: false, force: true do |t|
@@ -951,6 +952,7 @@ ActiveRecord::Schema.define do
t.string :poly_man_without_inverse_type
t.integer :horrible_polymorphic_man_id
t.string :horrible_polymorphic_man_type
+ t.references :human, polymorphic: true, index: false
end
create_table :interests, force: true do |t|