From e6c06a60905dab1359cc22dba301251d4bfaf62f Mon Sep 17 00:00:00 2001 From: Alexa Grey Date: Mon, 26 Feb 2024 16:21:45 -0800 Subject: [PATCH] [C] Remove double validations in resourceful actions --- api/app/controllers/concerns/api/v1/resourceful.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/app/controllers/concerns/api/v1/resourceful.rb b/api/app/controllers/concerns/api/v1/resourceful.rb index 0cfee44682..ca234170be 100644 --- a/api/app/controllers/concerns/api/v1/resourceful.rb +++ b/api/app/controllers/concerns/api/v1/resourceful.rb @@ -73,10 +73,10 @@ def auditing_security? # @param [Symbol] ok # @param [Symbol] error # @return [Symbol] - def build_status_for(model, ok, error, context) + def build_status_for(model, ok, error, _context) return ok unless action_name == "update" || action_name == "create" - model.valid?(context) ? ok : error + model.errors.none? ? ok : error end # @api private