github-ds icon indicating copy to clipboard operation
github-ds copied to clipboard

Use find_by_sql instead of select_all and send(:instantiate)

Open jhawthorn opened this issue 3 years ago • 1 comments

These are both private APIs, but _load_from_sql will give us even more standard behaviour (this is what find_by_sql calls) including emitting the instantiation.active_record notification.

This may be faster in some cases since _load_from_sql includes a fast path for when an inheritance column isn't present.

jhawthorn avatar Sep 23 '21 17:09 jhawthorn

Updated to just call find_by_sql. This is a slight behaviour change in that we'll now print out ex. "User Load" instead of "User Load via GitHub::SQL".

This move us to using a completely standard API 🎉

jhawthorn avatar Sep 23 '21 18:09 jhawthorn