From 81ad272e12d75d0268163ec5881b47d24affa540 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Fri, 24 Feb 2023 21:28:27 -0600 Subject: Refactorizar declaraciĆ³n de logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b8c3f46..49609c0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,7 +2,7 @@ # The father class of all controllers. class ApplicationController < ActionController::API - def logic - Object.const_get("#{self.class}::#{action_name.camelize}Logic") + def logic(permitted_params) + @logic ||= Object.const_get("#{self.class}::#{action_name.camelize}Logic").new(permitted_params) end end -- cgit v1.2.3