factory_bot 5.1.0 → 5.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33780ea65377b4977bbc2ee3e16e126da53fbca4b820bd621537fa5b14bb8d85
4
- data.tar.gz: f42bcc279ad3d3109ac513bcf73f07da96901fe00def25b8fbe4788ac96d1751
3
+ metadata.gz: 1d19c695ef0088d163b82c6b32066d4385d4be7fb8c0dc0b29c350d2e2187f2d
4
+ data.tar.gz: 55270eb96b553aa9b0c186bc7eeaf9d084fc79252b7fb8443d6276b1865168cc
5
5
  SHA512:
6
- metadata.gz: f51989b517d39a8254751e63b49b4705b8f104cb7a0ff52f073fd65243e7199ea39e8bad88c37edb1b3397fb362027be843bd196586f01a29d98b4d2accad112
7
- data.tar.gz: 2768474e23632487e2f8cec649a48d1721858c6cb7c4baf9ca79f3b5688d29e9fb448e42cca5cb6e20c046f90b458829055dae4e3d6ec5fc4a7983880ad5d8f5
6
+ metadata.gz: d61c40f944ae69e27a32e0992d8c289e9d0d9d5a48efe2998b8c53eca17be8a3591f886762866155032662e0eb32a4d52f342cfc1c88b22e637cab3d6e999f81
7
+ data.tar.gz: 2aa21a35633016a9e9871c9e56782af137a209ad1c155d51d768ba129d5dea016c54f9d1186191d2ed24e616f5d6516b78698488b8ee536fd929e28c7055ff1f
data/NEWS.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # News
2
2
 
3
+ ## 5.1.1 (October 2, 2019)
4
+ * Improved: performance of traits
5
+ * Fixed: registering strategies on JRuby
6
+
3
7
  ## 5.1.0 (September 21, 2019)
4
8
  * Added: "Did you mean?" style error message to help with typos in association declarations
5
9
  * Changed: `NoMethodError` for static attributes now offers a "Did you mean?" style message
@@ -115,13 +115,15 @@ module FactoryBot
115
115
  end
116
116
 
117
117
  def trait_for(name)
118
- defined_traits.detect { |trait| trait.name == name.to_s }
118
+ @defined_traits_by_name ||= defined_traits.each_with_object({}) { |t, memo| memo[t.name] ||= t }
119
+ @defined_traits_by_name[name.to_s]
119
120
  end
120
121
 
121
122
  def initialize_copy(source)
122
123
  super
123
124
  @attributes = nil
124
125
  @compiled = false
126
+ @defined_traits_by_name = nil
125
127
  end
126
128
 
127
129
  def aggregate_from_traits_and_self(method_name, &block)
@@ -86,7 +86,7 @@ module FactoryBot
86
86
  end
87
87
 
88
88
  def register_default_strategies
89
- DEFAULT_STRATEGIES.each(&method(:register_strategy))
89
+ DEFAULT_STRATEGIES.each { |name, klass| register_strategy(name, klass) }
90
90
  end
91
91
 
92
92
  def register_default_callbacks
@@ -1,3 +1,3 @@
1
1
  module FactoryBot
2
- VERSION = "5.1.0".freeze
2
+ VERSION = "5.1.1".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: 5.1.0
4
+ version: 5.1.1
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: 2019-09-21 00:00:00.000000000 Z
12
+ date: 2019-10-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -151,20 +151,6 @@ dependencies:
151
151
  - - ">="
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
- - !ruby/object:Gem::Dependency
155
- name: sqlite3
156
- requirement: !ruby/object:Gem::Requirement
157
- requirements:
158
- - - ">="
159
- - !ruby/object:Gem::Version
160
- version: '0'
161
- type: :development
162
- prerelease: false
163
- version_requirements: !ruby/object:Gem::Requirement
164
- requirements:
165
- - - ">="
166
- - !ruby/object:Gem::Version
167
- version: '0'
168
154
  - !ruby/object:Gem::Dependency
169
155
  name: yard
170
156
  requirement: !ruby/object:Gem::Requirement