factory_bot 6.0.1 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97d3a72c7d45c5c561f8c5ac318e8650d0f9787abeac65f598f06f0c04856727
4
- data.tar.gz: 3afcae7ade56a0d0e1858e4205e4356efce894afd1a87370759bff3199439a07
3
+ metadata.gz: 53cbce42f9c9fcf243a4081288b73cfce66a6b75a323f6882d6be4b4f60fcd18
4
+ data.tar.gz: 68df68b5a4501caa97f8e2538e3d1afb6e8ae619add80a52fff7bef2f8bda24b
5
5
  SHA512:
6
- metadata.gz: e3266e75f1419558703243a719bb837237f48b21757b4b6fd469a37340dcf426568238fea348a99f8b61402dc7f3fa8842bd9ea998850b701dfe7c64f47070ca
7
- data.tar.gz: f411a10292c3a4b47ded4de7ed26f6e2d13a2a5d9ab49805eed4e7ffe1a27d44c61f345afa701cb25bdbfc4c12509006c702253039d7d9137aa13605a5652d51
6
+ metadata.gz: '049104e865666570343adea5fd54e3025d5c4b550c7a364b22e4f9af8f24c8055e2fc21a168e752976569617bd0e4d02504904eb7274d7c7819d32936c164610'
7
+ data.tar.gz: 2bf0447a30a2e536f9eeaaccc724528c839a576ce0df7490f68ec86e683273a50e58ae5f7171c4e001c323adb8fe793427106dbcdc68987dc6ff28d3a4608d6f
data/NEWS.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # News
2
2
 
3
+ ## 6.0.2 (June 19, 2020)
4
+ * Fixed: bug causing traits to consume more memory each time they were used
5
+
3
6
  ## 6.0.1 (June 19, 2020)
4
7
  * Fixed: bug with constant resolution causing unexpected uninitialized constant errors
5
8
 
@@ -15,6 +15,7 @@ module FactoryBot
15
15
  @constructor = nil
16
16
  @attributes = nil
17
17
  @compiled = false
18
+ @expanded_enum_traits = false
18
19
  end
19
20
 
20
21
  delegate :declare_attribute, to: :declarations
@@ -143,6 +144,8 @@ module FactoryBot
143
144
  end
144
145
 
145
146
  def expand_enum_traits(klass)
147
+ return if @expanded_enum_traits
148
+
146
149
  if automatically_register_defined_enums?(klass)
147
150
  automatically_register_defined_enums(klass)
148
151
  end
@@ -151,6 +154,8 @@ module FactoryBot
151
154
  traits = enum.build_traits(klass)
152
155
  traits.each { |trait| define_trait(trait) }
153
156
  end
157
+
158
+ @expanded_enum_traits = true
154
159
  end
155
160
 
156
161
  def automatically_register_defined_enums(klass)
@@ -1,3 +1,3 @@
1
1
  module FactoryBot
2
- VERSION = "6.0.1".freeze
2
+ VERSION = "6.0.2".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factory_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Clayton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-06-19 00:00:00.000000000 Z
12
+ date: 2020-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport