Remove deprecated nil-passing to `SchemaCache` methods.
build fix: railties tests used deprecated `SchemaCache` methods.
Correctly handle relations as values in where() for polymorphic associations.