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:
parent
b69fa21e53
commit
74aea5e2d5
@ -23,7 +23,7 @@ class Api::V1::Accounts::AgentsController < Api::V1::Accounts::BaseController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update
|
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?
|
user_attrs[:ui_settings] = merged_ui_settings if agent_params[:ui_settings].present?
|
||||||
@agent.update!(user_attrs) if user_attrs.any?
|
@agent.update!(user_attrs) if user_attrs.any?
|
||||||
@agent.current_account_user.update!(agent_params.slice(*account_user_attributes).compact)
|
@agent.current_account_user.update!(agent_params.slice(*account_user_attributes).compact)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user