redding/mr — pull request #194 by jcredding (2014-03-19 22:23:40+00:00)
Title: Change applying args logic for model and record factories

This changes the applying args logic for model and record
factories. Instead of building a single large hash, this applies
each level of args independently. This fixes issues related to
setting attributes for associated objects. If an association is
defaulted through a factories default args and then a hash of
attributes for the same association is passed to the `instance`
method, the previous implementation would overwrite the default.
This allows the default to be applied first and then apply the
passed args over it. This also helps with polymorphic association
columns. The foreign type column can be defaulted and then a
parent instance can be passed without conflict. This is all to
make factories and stacks easier to work with in a test suite.

This also removes the `apply_args` method as a public method
on factories. I thought this might be useful in some cases, but
that hasn't turned out to be true.

Related to #112

@kellyredding - Ready for review. This is the first part of fixing #112. As we saw, this only half-fixes the problem. Record stacks need to load all the preset associations to fully fix #112. That will be in the next PR.