From 74aea5e2d56678d38e46cc0428f7e96de9993e2d Mon Sep 17 00:00:00 2001 From: Rodribm10 Date: Fri, 24 Apr 2026 14:27:11 -0300 Subject: [PATCH] fix(agents): converte Parameters pra Hash antes de chamar any? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ActionController::Parameters não tem .any?; chamar sem to_h quebra com NoMethodError (500) ao salvar agente. Bug introduzido em b69fa21e5. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/controllers/api/v1/accounts/agents_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v1/accounts/agents_controller.rb b/app/controllers/api/v1/accounts/agents_controller.rb index d0e7093b9..57509bd45 100644 --- a/app/controllers/api/v1/accounts/agents_controller.rb +++ b/app/controllers/api/v1/accounts/agents_controller.rb @@ -23,7 +23,7 @@ class Api::V1::Accounts::AgentsController < Api::V1::Accounts::BaseController end def update - user_attrs = agent_params.slice(:name).compact + user_attrs = agent_params.slice(:name).to_h.compact.symbolize_keys user_attrs[:ui_settings] = merged_ui_settings if agent_params[:ui_settings].present? @agent.update!(user_attrs) if user_attrs.any? @agent.current_account_user.update!(agent_params.slice(*account_user_attributes).compact)