diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-05-07 02:26:31 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-18 00:41:43 +0900 |
commit | 49bcb008cbaf0fa2db727ae58e7e27015a7ae02c (patch) | |
tree | e626fb51981577b56b849af5194ec64e797543a7 /activerecord/test/models | |
parent | 25b3cbb241a334d750eed24f5094151e52ed7c69 (diff) | |
download | rails-49bcb008cbaf0fa2db727ae58e7e27015a7ae02c.tar.gz rails-49bcb008cbaf0fa2db727ae58e7e27015a7ae02c.tar.bz2 rails-49bcb008cbaf0fa2db727ae58e7e27015a7ae02c.zip |
Fix eager loading polymorphic association with mixed table conditions
This fixes a bug that the `foreign_key` and the `foreign_type` are
separated as different table conditions if a polymorphic association has
a scope that joins another tables.
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/rating.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/models/rating.rb b/activerecord/test/models/rating.rb index cf06bc6931..49aa38285f 100644 --- a/activerecord/test/models/rating.rb +++ b/activerecord/test/models/rating.rb @@ -3,4 +3,5 @@ class Rating < ActiveRecord::Base belongs_to :comment has_many :taggings, as: :taggable + has_many :taggings_without_tag, -> { left_joins(:tag).where("tags.id": nil) }, as: :taggable, class_name: "Tagging" end |