This issue only affects Active Record 5.2.
In Active Record < 5.2, polymorphic joins will include a condition on the _type column.
LEFT OUTER JOIN "people"
ON "people"."id" = "notes"."notable_id" AND "notes"."notable_type" = 'Person'
In Active Record 5.2, the condition will not be included:
LEFT OUTER JOIN "people"
ON "people"."id" = "notes"."notable_id"