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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96b5b25a348686d9d0e394b4a8de682a4fb49fe83ae4038f758905c50cd2d57b
4
- data.tar.gz: 169f33bb5c12fed9548be6b010a06b0b5e71e6867950ec2a6344d63d82b75605
3
+ metadata.gz: cd4158347cdd07c24704cef28823fee2a36da8ff245ca904dcc7a4f2554f1b35
4
+ data.tar.gz: 3ad522d063147cc2db17aba8a44328cb87a10b6dcf285adcfb4e02bc5ab86f1d
5
5
  SHA512:
6
- metadata.gz: e238bf844535aa25a1fa01097ebfe49df0fe5edca86d4e4eb64d970f8bd47bfe90ee125596c1411ce0df52cb3d018466170da866b82fe24a7fa4f9e9e97acc9d
7
- data.tar.gz: cd1ece3fad8c3325d5da64103705e132c291934438a58638e5d966289815be6b8cda0552f2d040a04d9924d66107f92ccb1c50978ee1d82df87302428aefe2a4
6
+ metadata.gz: bba849cae19f841877a2cfa2421e23a75560c9b75f96d1934a3db3128f1345b7349d86925795494c7b6e785bf0a19876d5b6dd6375c09dbed96a3ae2e86187cd
7
+ data.tar.gz: 2edd6b923df8ddb5e4a07c755bda1c9b279776236f587fc333043ee62bb82172dd0bf578c0f7f2297156b4dd057a775d5ef43b277cf6cb8d85ef8dc337065dba
data/NEWS.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # News
2
2
 
3
+ ## 6.4.1 (November 20, 2023)
4
+
5
+ * Fix: factories with traits pass their class to ActiveSupport::Notifications
6
+ (makicamel).
7
+
3
8
  ## 6.4.0 (November 17, 2023)
4
9
 
5
10
  * Added: if `build_stubbed` detects a UUID primary key, generate the correct
@@ -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
@@ -15,7 +15,7 @@ module FactoryBot
15
15
  end
16
16
 
17
17
  delegate :add_callback, :declare_attribute, :to_create, :define_trait, :constructor,
18
- :callbacks, :attributes, to: :@definition
18
+ :callbacks, :attributes, :klass, :klass=, to: :@definition
19
19
 
20
20
  def names
21
21
  [@name]
@@ -1,3 +1,3 @@
1
1
  module FactoryBot
2
- VERSION = "6.4.0".freeze
2
+ VERSION = "6.4.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: 6.4.0
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-17 00:00:00.000000000 Z
12
+ date: 2023-11-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport