factory_bot_instrumentation 3.2.0 → 3.2.1

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: a3ffdbe89a6d52f2e42501cda7e16486837898cc3e98b11eecc4259f4c62ca13
4
- data.tar.gz: ea11aa96c68c2d8b0b5d82b93a1b4b2f1d558c2cf5a3180ff39f4bd2733d840e
3
+ metadata.gz: '08e3d4ce4136029c07728a5cab9d09cd70971a0309b19f2c7a45d1d803394b5c'
4
+ data.tar.gz: b60890e825ea6a95308ca8000e462cffaecaa2b314b9d8de097b117c7d0ee461
5
5
  SHA512:
6
- metadata.gz: 1f3bac980f8316e752de81f09afc1434a26eff5778d4906910de50efcc3f2a0a5ae2b6ebaa8e4e62b590380c6de08c8961df56fe1a8915c126da495c853407e8
7
- data.tar.gz: d4d79cfd4b72f5ca9d9d54afe4f684837ce68bf1b99f789d07d52fd52f03319a6549bac8ddfdf98234776fbdfff933ea3630912e792104a625819031c70a9829
6
+ metadata.gz: 7e638032848f7d4f2f601c64a6616a269471f55b133fedb275e2053ddc9167bae2913e48b9b36f30fad5748c6ef6dbe514fd0fa55285f79f94e12f1f9c96cd16
7
+ data.tar.gz: 58b99a21082090a8ad4d2e30ce3bafd242f87253c73e12278259d128097f4a7f0a6c191d88122caecced2e71179653132b81ab81d63197e9b519744832a49480
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  * TODO: Replace this bullet point with an actual description of a change.
4
4
 
5
+ ### 3.2.1 (26 June 2026)
6
+
7
+ * Disabled parameter wrapping to silence spurious unpermitted parameter log
8
+ warnings ([#49](https://github.com/hausgold/factory_bot_instrumentation/pull/49))
9
+
5
10
  ### 3.2.0 (19 June 2026)
6
11
 
7
12
  * Improved the title and navigation title on the Instrumentation UI ([#48](https://github.com/hausgold/factory_bot_instrumentation/pull/48))
@@ -4,6 +4,13 @@ module FactoryBot
4
4
  module Instrumentation
5
5
  # The Instrumentation engine controller with frontend and API actions.
6
6
  class RootController < FactoryBot::Instrumentation::ApplicationController
7
+ # Disable Rails' parameter wrapping. For JSON requests it would nest
8
+ # a copy of the request body under a +root+ key (derived from this
9
+ # controller's name). There is no +Root+ model to map onto, so the
10
+ # wrapper only duplicates the parameters and adds a spurious
11
+ # "Unpermitted parameters: :root" log warning.
12
+ wrap_parameters false
13
+
7
14
  # Show the instrumentation frontend which features the output of
8
15
  # configured dynamic seeds scenarios. The frontend allows humans to
9
16
  # generate new seed data on the fly.
@@ -52,14 +59,15 @@ module FactoryBot
52
59
  #
53
60
  # @return [Array<Mixed>] the FactoryBot options
54
61
  def factory_params
55
- data = params.permit(:factory, traits: [])
56
-
57
- overwrite = if Rails::VERSION::MAJOR >= 5
58
- params.to_unsafe_h.fetch(:overwrite, {})
59
- .deep_symbolize_keys
60
- else
61
- params.fetch('overwrite', {}).deep_symbolize_keys
62
- end
62
+ # Read the open-ended +overwrite+ hash unfiltered, as its keys and
63
+ # values are arbitrary and cannot be described with strong
64
+ # parameters.
65
+ overwrite = params.to_unsafe_h.fetch(:overwrite, {})
66
+ .deep_symbolize_keys
67
+ # Strip +overwrite+ before permitting the rest, otherwise it would
68
+ # be reported as a spurious "Unpermitted parameters: :overwrite"
69
+ # log warning.
70
+ data = params.except(:overwrite).permit(:factory, traits: [])
63
71
 
64
72
  [
65
73
  data.fetch(:factory).to_sym,
@@ -4,7 +4,7 @@ module FactoryBot
4
4
  # The gem version details.
5
5
  module Instrumentation
6
6
  # The version of the +factory_bot_instrumentation+ gem
7
- VERSION = '3.2.0'
7
+ VERSION = '3.2.1'
8
8
 
9
9
  class << self
10
10
  # Returns the version of gem as a string.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factory_bot_instrumentation
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hermann Mayer