gocardless/statesman — pull request #34 by figwit (2014-04-03 15:46:31+00:00)
Title: Favour eager loaded transitions.

Avoid hits on an RDMBS if the associated transitions have already been loaded. Allows for avoidance of N+1 queries on a collection of objects when calculating, for example, the `#current_state`, by favouring pre-fetched data (e.g. `default_scope { eager_load :order_transitions }`).