Skip to content

Commit 2b7d54e

Browse files
committed
refactor: consolidate handling of tags and responseFields for improved clarity
1 parent 75820cd commit 2b7d54e

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

lib/imagekit/models/beta/v2/file_upload_params.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,8 @@ def self.serialize_upload_options(upload_options)
5151
end
5252

5353
serialized[key] = case key
54-
when :tags
55-
# Tags should be comma-separated string
56-
value.is_a?(Array) ? value.join(",") : value
57-
when :responseFields
58-
# Response fields should be comma-separated string
54+
when :tags, :responseFields
55+
# Tags and response fields should be comma-separated strings
5956
value.is_a?(Array) ? value.join(",") : value
6057
when :extensions
6158
# Extensions should be JSON stringified

lib/imagekit/models/file_upload_params.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,8 @@ def self.serialize_upload_options(upload_options)
4949
end
5050

5151
serialized[key] = case key
52-
when :tags
53-
# Tags should be comma-separated string
54-
value.is_a?(Array) ? value.join(",") : value
55-
when :responseFields
56-
# Response fields should be comma-separated string
52+
when :tags, :responseFields
53+
# Tags and response fields should be comma-separated strings
5754
value.is_a?(Array) ? value.join(",") : value
5855
when :extensions
5956
# Extensions should be JSON stringified

0 commit comments

Comments
 (0)