ionia-corporation/active_force — pull request #55 by DanOlson (2014-09-02 03:02:27+00:00)
Title: Includes (eager load associations)

This is still a work in progress, but addresses #34 to add `includes`. I wanted to get some feedback on the approach before going too far.

What this does:

* Refactors associations to use reflections a la ActiveRecord. This sets the groundwork for `includes` by storing and making available metadata about associations rather than just adding instance methods to SObject subclasses.
* Adds a basic `SObject.includes` method that formulates a relationship query to SFDC to fetch attributes of an object related to the primary object.
* So far, only a single `belongs_to` association is supported, but I'm getting tired and really should go to bed.

Left to do (minimum viable product):

* Wire up an association from attributes returned from the API query.
* `has_many` support
* `includes` should have variable arity and accept both `has_many` and `belongs_to` associations.

Please add to this TODO list as you see fit, and provide other feedback... I'm hoping this can start a discussion.

Thanks guys!