davidpdrsn / juniper-eager-loading

Library for avoiding N+1 query bugs with Juniper
68 stars 8 forks source link

Simplify EagerLoadChildrenOfType with Association trait #29

Closed davidpdrsn closed 5 years ago

davidpdrsn commented 5 years ago

This removes the loaded_child and assert_loaded_otherwise_failed methods of EagerLoadChildrenOfType and insteads calls those through a new trait called Association. That trait is implemented for each type of association. Will reduce some boilerplate in handwritten implementations.