structured_params 0.9.0 → 0.9.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: 439ee43f03104eab1cab3d22b88f080eb4b3a4b3f995f3207f34b43f1131d850
4
- data.tar.gz: 6c8a9bbcdc63a3421943e470e0eae9fd8985bf9c492fbfe3d78ac1c1fb91f480
3
+ metadata.gz: 7df8a9794d83f7ff21ab449fcc1c8d294ef6fcc2f07efa3f06312847efd98351
4
+ data.tar.gz: 06b6b58ad9d4b5969ae944a4d84b49cb7eb163c8096ced05d345384b418ad651
5
5
  SHA512:
6
- metadata.gz: 37250d2347c47d83fb46e607498b9e27b0f75c2f1c63d51195b2897b46c9b421bb0612fff0ab8fa2e98bcd2b5ebafc5fee013e7b3717850dfcc7af74b684f214
7
- data.tar.gz: cfcbce547b38e7680a94804ed0df7112c0f03218d2998b4e48917f702353942eaf5cd5c854fe43cf9ada08a2546a06e96038ea9ef707caec210cb2e1c2b11272
6
+ metadata.gz: 9c67223de7d299fc05e4edb7d3f07a662ab08517f1fd515ecd20b5fed2bcbd9c1415a91ec64ec96ca71d79e584eb456b56e3a16ca1e5877f75c837f0be4817a3
7
+ data.tar.gz: a219e6a26311d776b6b68c3dee2a0ea40bc7faf4cbb00cf55fd9f390e3594bb862514aff5fc833477540bac3acf3f6173e08c97026379369b8bd6fd6019bcfcf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.1] - 2026-03-18
4
+
5
+ **Full Changelog**: https://github.com/Syati/structured_params/compare/v0.9.0...v0.9.1
6
+
3
7
  ## [0.9.0] - 2026-03-18
4
8
 
5
9
  ## What's Changed
@@ -45,11 +45,25 @@ module StructuredParams
45
45
  end
46
46
 
47
47
  # Get permitted parameter names for use with Strong Parameters
48
+ #
49
+ # Returns:
50
+ # - For object arrays (value_class): nested keys from the object
51
+ # Example: HobbyParams with [:name, :level]
52
+ # → returns [:name, :level]
53
+ # → becomes { hobbies: [:name, :level] } in Params#permit_attribute_names
54
+ #
55
+ # - For primitive arrays (value_type): empty array
56
+ # Example: attribute :tags, :array, value_type: :string
57
+ # → returns []
58
+ # → becomes { tags: [] } in Params#permit_attribute_names
59
+ # → finally used as params.permit(:name, { tags: [] })
60
+ #
48
61
  #: () -> ::Array[untyped]
49
62
  def permit_attribute_names
50
- return [] unless item_type_is_structured_params_object?
63
+ return @item_type.permit_attribute_names if item_type_is_structured_params_object?
51
64
 
52
- @item_type.permit_attribute_names
65
+ # Primitive arrays return [] for Strong Parameters format
66
+ []
53
67
  end
54
68
 
55
69
  # Determine if item type is StructuredParams::Object
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module StructuredParams
5
- VERSION = '0.9.0' #: string
5
+ VERSION = '0.9.1' #: string
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: structured_params
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mizuki Yamamoto