redding/mr — pull request #97 by jcredding (2013-10-29 19:06:56+00:00)
Title: Add new interface for read model querying, only basics for now

This adds a new mixin `MR::ReadModel::Querying`. This mixin will
be used to update read models to provide a fully-featured API
for querying data from the DB. For now this only implements the
basic interface and tests it. This only includes the DSL methods
`from`, `select` and `joins` and the `query` method. The `from`
method takes a record class to build the relation from and the
`select` and `joins` methods map to ActiveRecord's querying.
This doesn't make any changes to the `MR::ReadModel` mixin yet,
this is just setup for changing it.

MR's read model querying tried to optimize building the relation
as much as possible. When the DSL methods are called, they will
see if they can be immediately applied to the relation or not.
With this, a minimal number of "expressions" have to be applied
to the relation when the read model is queried.

For now, a `MR::ReadModel::Configuration` has been broken out as
well, even though it's current contents are trivial. This will
probably be expanded on as a read model's fields are implemented.

Related to #88