james2m/seedbank — pull request #39 by rsutphin (2014-07-16 17:17:49+00:00)
Title: Allow reinvoking seed tasks

Rake allows a task to be "reenabled" to run more than once in the same overall rake process. Prior to this commit, if you attempted to reinvoke a seedbank task, the task expressing its dependencies would be redefined. The effect of that redefinition was that the seed data code would effectively run twice on the second invocation, three times on the third, etc.

Reinvoking seed tasks can be useful within a test suite. It allows you to define real seed data for just the tests that need it, avoiding overhead and the complications of a non-empty database for tests that don't need the seed data.