factory_girl-cache 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -27,14 +27,11 @@ To clear the cache:
27
27
 
28
28
  This may seem completely odd, e.g. creating something would imply really creating a new instance, as would building. And you'll get the same id back. Why would you want to do that?
29
29
 
30
- By caching factory-created/built/stubbed instances and lists, you may be able to at least temporarily avoid issues with circular references and reduce time spent on nested model creation avoiding the dreaded:
31
-
32
- SystemStackError:
33
- stack level too deep
30
+ Originally, the idea was that this could be used to avoid circular references, but there are other complexities in factory interdependencies that keep the cache alone from being a silver bullet for those issues. However, for some cases it could still significantly speed up accessing factory created instances, if you are careful.
34
31
 
35
32
  This gem should not affect FactoryGirl itself. It just provides an alternate way to use FactoryGirl that makes it behave a bit differently.
36
33
 
37
- Please understand what you are doing by using this. This is not just some way to make FactoryGirl faster.
34
+ Please understand what you are doing by using this. Handle it carefully and don't shoot yourself with it!
38
35
 
39
36
  ### Installation
40
37
 
@@ -13,9 +13,9 @@ module FactoryGirlCache
13
13
  keys = args.dup
14
14
  args.delete_at(1) if args.size > 1 && args[1].is_a?(Symbol)
15
15
  @factory_girl_cache ||= {}
16
- @factory_girl_cache[[m, *keys]] ||= Math.__send__(m, *args, &block)
16
+ @factory_girl_cache[[m, *keys]] ||= FactoryGirl.__send__(m, *args, &block)
17
17
  else
18
- Math.__send__(m, *args, &block)
18
+ FactoryGirl.__send__(m, *args, &block)
19
19
  end
20
20
  end
21
21
 
@@ -1,3 +1,3 @@
1
1
  module FactoryGirlCache
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factory_girl-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: