redding/mr — pull request #85 by jcredding (2013-07-26 06:04:59+00:00)
Title: Fix bug with factories not applying defaults

This fixes a bug that came up where factories didn't seem to apply
defaults for their models/records. This occurred when a factory
generated an instance or stack twice in a row. Essentially, the
first would modify the defaults permanently so the second would
have different defaults applied to it. This is because ruby's
`dup` is not a deep copy of objects, so for hashes, this only
goes one level deep. Thus, you had to run a factory twice in a
row and the defaults had to be at least two levels deep for this
bug to show up. This modifies the logic to properly `dup` the
hashes as they are recursively applied. This `dup`'s the hashes
that are embedded deeper in the args being applied.

Closes #84