From 3bba6aa4733b2655e5504a0c62ac3d1604351da2 Mon Sep 17 00:00:00 2001 From: Justin Lei Date: Mon, 22 Jun 2026 15:07:34 -0400 Subject: [PATCH] fix: allow custom config_key in check_user_profile Expose an optional config_key keyword argument on ModerationClient#check_user_profile so callers can target prefix-based custom moderation configs (e.g. user_profile:custom), while preserving the existing user_profile:default behavior. Co-Authored-By: Claude Opus 4.7 (1M context) --- lib/getstream_ruby/extensions/moderation_extensions.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/getstream_ruby/extensions/moderation_extensions.rb b/lib/getstream_ruby/extensions/moderation_extensions.rb index 2dc1ccda..81b64a11 100644 --- a/lib/getstream_ruby/extensions/moderation_extensions.rb +++ b/lib/getstream_ruby/extensions/moderation_extensions.rb @@ -19,12 +19,13 @@ class ModerationClient # @param profile [Hash] Profile data to be checked # @option profile [String] :username Username to be checked # @option profile [String] :image Image URL to be checked + # @param config_key [String] Moderation config key to use (defaults to 'user_profile:default'). # @return [Models::CheckResponse] # # @example # client.moderation.check_user_profile('user-id', # { username: 'bad_username', image: 'https://example.com/profile.jpg' }) - def check_user_profile(user_id, profile) + def check_user_profile(user_id, profile, config_key: 'user_profile:default') if profile[:username].nil? && profile[:image].nil? raise ArgumentError, 'Either username or image must be provided' end @@ -38,7 +39,7 @@ def check_user_profile(user_id, profile) entity_id: user_id, entity_creator_id: user_id, moderation_payload: moderation_payload, - config_key: 'user_profile:default', + config_key: config_key, options: { force_sync: true, test_mode: true }, )