Permalink
Browse files

Pass overrides when constructing Runner

  • Loading branch information...
1 parent d3a7b7e commit 5fc57dacf7504d3dd32f8a092ea258fc34b47236 @joshuaclayton joshuaclayton committed Dec 2, 2011
Showing with 6 additions and 7 deletions.
  1. +6 −7 lib/factory_girl/factory.rb
@@ -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
@@ -100,6 +101,7 @@ def with_traits(traits)
def class_name #:nodoc:
@class_name || parent.class_name || name
+
end
def attributes
@@ -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

0 comments on commit 5fc57da

Please sign in to comment.