factory_bot 6.4.0 → 6.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +5 -0
- data/lib/factory_bot/definition.rb +3 -1
- data/lib/factory_bot/trait.rb +1 -1
- data/lib/factory_bot/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd4158347cdd07c24704cef28823fee2a36da8ff245ca904dcc7a4f2554f1b35
|
4
|
+
data.tar.gz: 3ad522d063147cc2db17aba8a44328cb87a10b6dcf285adcfb4e02bc5ab86f1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bba849cae19f841877a2cfa2421e23a75560c9b75f96d1934a3db3128f1345b7349d86925795494c7b6e785bf0a19876d5b6dd6375c09dbed96a3ae2e86187cd
|
7
|
+
data.tar.gz: 2edd6b923df8ddb5e4a07c755bda1c9b279776236f587fc333043ee62bb82172dd0bf578c0f7f2297156b4dd057a775d5ef43b277cf6cb8d85ef8dc337065dba
|
data/NEWS.md
CHANGED
@@ -2,6 +2,7 @@ module FactoryBot
|
|
2
2
|
# @api private
|
3
3
|
class Definition
|
4
4
|
attr_reader :defined_traits, :declarations, :name, :registered_enums
|
5
|
+
attr_accessor :klass
|
5
6
|
|
6
7
|
def initialize(name, base_traits = [])
|
7
8
|
@name = name
|
@@ -52,6 +53,7 @@ module FactoryBot
|
|
52
53
|
declarations.attributes
|
53
54
|
|
54
55
|
defined_traits.each do |defined_trait|
|
56
|
+
defined_trait.klass ||= klass
|
55
57
|
base_traits.each { |bt| bt.define_trait defined_trait }
|
56
58
|
additional_traits.each { |at| at.define_trait defined_trait }
|
57
59
|
end
|
@@ -62,7 +64,7 @@ module FactoryBot
|
|
62
64
|
name: name,
|
63
65
|
attributes: declarations.attributes,
|
64
66
|
traits: defined_traits,
|
65
|
-
class: klass
|
67
|
+
class: klass || self.klass
|
66
68
|
}
|
67
69
|
end
|
68
70
|
end
|
data/lib/factory_bot/trait.rb
CHANGED
data/lib/factory_bot/version.rb
CHANGED
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.4.
|
4
|
+
version: 6.4.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: 2023-11-
|
12
|
+
date: 2023-11-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|