You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lookup polymorphic type from the column before the record (#1326)
Currently, `Relationship#type_for_source` looks up polymorphic source's
type by:
1. Fetching its associated record.
2. Calling `.class._type` on that record.
This approach is inefficient because usually, a polymorphic record (the
`source`) has
`_type` and `_id` columns. And the `_type` column's value will be the
polymorphic relationship record's type.
So this PR makes `type_for_source` check the type value from column
before fetching the associated record.
0 commit comments