aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-05-07 02:26:31 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-02-18 00:41:43 +0900
commit49bcb008cbaf0fa2db727ae58e7e27015a7ae02c (patch)
treee626fb51981577b56b849af5194ec64e797543a7 /activerecord/test/models
parent25b3cbb241a334d750eed24f5094151e52ed7c69 (diff)
downloadrails-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.rb1
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