factory_girl-cache 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ module FactoryGirlCache
|
|
11
11
|
if [:build, :build_list, :build_stubbed, :create, :create_list].include?(m)
|
12
12
|
keys = args.dup
|
13
13
|
options = args.last
|
14
|
-
cached_as = options.is_a?(Hash) ? options.
|
14
|
+
cached_as = options.is_a?(Hash) ? options.delete(:cached_as) : nil
|
15
15
|
keys[0] = cached_as if !(cached_as.nil?) && keys.size > 0
|
16
16
|
@factory_girl_cache ||= {}
|
17
17
|
@factory_girl_cache[[m, *keys]] ||= FactoryGirl.__send__(m, *args, &block)
|