mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
49bcb008cb
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.
7 lines
245 B
Ruby
7 lines
245 B
Ruby
# frozen_string_literal: true
|
|
|
|
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
|