We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e0ca23c commit 2b50657Copy full SHA for 2b50657
lib/structured_params/type/array.rb
@@ -47,9 +47,11 @@ def serialize(value)
47
# Get permitted parameter names for use with Strong Parameters
48
#: () -> ::Array[untyped]
49
def permit_attribute_names
50
- return [] unless item_type_is_structured_params_object?
+ return @item_type.permit_attribute_names if item_type_is_structured_params_object?
51
52
- @item_type.permit_attribute_names
+ # Primitive arrays return [] for Strong Parameters format.
53
+ # Example: tags: [] allows params.permit(tags: [])
54
+ []
55
end
56
57
# Determine if item type is StructuredParams::Object
0 commit comments