github-ds
github-ds copied to clipboard
Use find_by_sql instead of select_all and send(:instantiate)
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.
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 🎉