Navigation Menu

Skip to content

Commit

Permalink
Pass overrides when constructing Runner
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaclayton committed Dec 2, 2011
1 parent d3a7b7e commit 5fc57da
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/factory_girl/factory.rb
Expand Up @@ -41,10 +41,11 @@ def run(proxy_class, overrides, &block) #:nodoc:
:callbacks => callbacks,
:to_create => to_create,
:build_class => build_class,
:proxy_class => proxy_class
:proxy_class => proxy_class,
:overrides => overrides.dup
}

block[Runner.new(runner_options).run(overrides)]
block[Runner.new(runner_options).run]
end

def human_names
Expand Down Expand Up @@ -100,6 +101,7 @@ def with_traits(traits)

def class_name #:nodoc:
@class_name || parent.class_name || name

end

def attributes
Expand Down Expand Up @@ -150,13 +152,10 @@ def initialize(options = {})
@to_create = options[:to_create]
@build_class = options[:build_class]
@proxy_class = options[:proxy_class]

@overrides = {}
@overrides = options[:overrides]
end

def run(overrides = {})
@overrides = overrides.symbolize_keys

def run
apply_attributes
apply_remaining_overrides

Expand Down

0 comments on commit 5fc57da

Please sign in to comment.