Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

pull request: singleton factories #24

Closed
erikh opened this Issue · 1 comment

2 participants

@erikh

http://github.com/erikh/factory_girl

Patch adds proxy-specific Factory.define options.

Patch adds a :singleton_on attribute to Factory.define; see README.rdoc for use-case information, but the basic gist is that when going through the create proxy, the value of the :singleton_on parameter is used on the generated instance to find a target, which is then searched for in the model the instance was created from. If an object is found, it is used instead of creating a new one, and then saved.

Tests added, pull request sent, working in real-world scenarios already.

@stevenderocher

We feel this need is adequately covered by the use of Rails' seed data feature.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.