From ed20ad9237804301d795d65f4ec49c2d06245dad Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 11 Feb 2023 15:41:17 +0100 Subject: [PATCH] Fix class check for parameter errors --- app/controllers/concerns/turbo_streamable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/turbo_streamable.rb b/app/controllers/concerns/turbo_streamable.rb index fd1d8f86..5066bc05 100644 --- a/app/controllers/concerns/turbo_streamable.rb +++ b/app/controllers/concerns/turbo_streamable.rb @@ -20,7 +20,7 @@ module TurboStreamable rescue Errors::Base => e render_error I18n.t(e.locale_tag) rescue KeyError, ActionController::ParameterMissing => e - render_error t("errors.parameter_error", parameter: e.is_a?(KeyError) ? e.key : e.param.capitalize) + render_error t("errors.parameter_error", parameter: e.instance_of?(KeyError) ? e.key : e.param.capitalize) rescue Dry::Types::CoercionError, Dry::Types::ConstraintError render_error t("errors.invalid_parameter") rescue ActiveRecord::RecordNotFound