fix(agents): converte Parameters pra Hash antes de chamar any?

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) <noreply@anthropic.com>
This commit is contained in:
Rodribm10 2026-04-24 14:27:11 -03:00
parent b69fa21e53
commit 74aea5e2d5

View File

@ -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)