redding/mr — pull request #105 by jcredding (2013-11-04 20:11:18+00:00)
Title: Create `MR::Model::Associations` mixin

This moves the associations logic for a model into a separate
mixin. The goal of this is to properly split up the model's
interface into smaller components that work together. For the
most part, this is an internal change and will provide the same
interface that `MR::Model` currently does. This doesn't change
any of `MR::Model`'s behavior yet. This is just setup for changing
it later.

This does some simplification to model associations. When adding
polymorphic belongs to associations, we made it so an association
doesn't have to be provided it's model class. This is now true
for all associations. This simplifies them and should also fix
a bug with factories and fake record associations. The factories
would build "real" records instead of fake ones. Now that a model
always looks to it's record's association's record class, it will
use the correct fake or real class.

Finally, this makes associations more friendly in that they will
error if there record doesn't have a matching association. This
helps to ensure strange `NoMethodError` issues are avoided.

Closes #67
Related to #70
Related to #72