{"issue":{"created_at":"2010-06-29T15:05:15Z","state":"closed","updated_at":"2011-12-10T22:23:23Z","comments":14,"user":{"gravatar_id":"18c2795810ee15d41956e7f4cc5f3338","id":18374,"url":"https://api.github.com/users/jcf","avatar_url":"https://secure.gravatar.com/avatar/18c2795810ee15d41956e7f4cc5f3338?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jcf"},"body":"When you define and build a factory any associations are created, rather than built. This is slow and feels kinda quirky. Instead the associated objects could be built as you would in Rails, only using memory as opposed to foreign keys and potentially lots of selects and inserts.\n\nI've forked, branched and committed a change, with passing tests that hopefully will fix this in a way you agree is acceptable.\n\nhttp://github.com/jcf/factory_girl/tree/build_association\n\nRegards,\n\nJames","assignee":null,"id":233950,"number":64,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[{"name":"feature","color":"18911a","url":"https://api.github.com/repos/thoughtbot/factory_girl/labels/feature"}],"title":"Building an object creates associations","html_url":"https://github.com/thoughtbot/factory_girl/issues/64","closed_at":"2011-08-26T13:49:05Z","url":"https://api.github.com/repos/thoughtbot/factory_girl/issues/64","milestone":{"created_at":"2011-07-05T22:10:55Z","state":"closed","closed_issues":2,"due_on":null,"creator":{"gravatar_id":"7fd56fa98da45bc532e898132085bd05","id":7591,"url":"https://api.github.com/users/jferris","avatar_url":"https://secure.gravatar.com/avatar/7fd56fa98da45bc532e898132085bd05?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jferris"},"number":1,"description":"","title":"2.1","url":"https://api.github.com/repos/thoughtbot/factory_girl/milestones/1","open_issues":0}},"action":"created","comment":{"created_at":"2011-12-10T22:23:23Z","updated_at":"2011-12-10T22:23:23Z","user":{"gravatar_id":"2fc466c3bc212d562e967cc4a1a1dbf3","id":383376,"url":"https://api.github.com/users/urbanautomaton","avatar_url":"https://secure.gravatar.com/avatar/2fc466c3bc212d562e967cc4a1a1dbf3?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"urbanautomaton"},"body":"@gamov, I was just reading the pull request for this feature, #191, and it appears that the `:method => :build` option actually works in the way you would like - it only applies if the parent factory is built, and does not affect the create or build_stubbed methods. See [spec/acceptance/create_spec.rb](https://github.com/thoughtbot/factory_girl/blob/master/spec/acceptance/create_spec.rb#L55) for an example test. So really, it is indeed a `:current_strategy` option.","id":3093778,"url":"https://api.github.com/repos/thoughtbot/factory_girl/issues/comments/3093778"}}