1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

fix StiAutoloading example code

without the `.unscoped` call this can break if a base model happens to have a default scope.
This commit is contained in:
jonathan schatz 2020-03-19 16:06:46 -07:00 committed by GitHub
parent d9dc569d5b
commit e2a4512dc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -230,6 +230,7 @@ module StiPreload
def preload_sti
types_in_db = \
base_class.
unscoped.
select(inheritance_column).
distinct.
pluck(inheritance_column).