From fb4228b873e5e1873b82c38498c18f992df73fdb Mon Sep 17 00:00:00 2001 From: f Date: Mon, 15 Apr 2024 16:58:55 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20no=20filtrar=20informaci=C3=B3n=20privad?= =?UTF-8?q?a!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/application_record.rb | 7 +++++++ config/initializers/filter_parameter_logging.rb | 1 + 2 files changed, 8 insertions(+) diff --git a/app/models/application_record.rb b/app/models/application_record.rb index 71fbba5b..27ed3d56 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -2,4 +2,11 @@ class ApplicationRecord < ActiveRecord::Base self.abstract_class = true + + # Obtener una lista filtrada de atributos al momento de serializar + # + # @return [Hash] + def to_yaml(options = {}) + self.class.inspection_filter.filter attributes + end end diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index 2fc446ff..8ef6ca49 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -5,4 +5,5 @@ # Configure sensitive parameters which will be filtered from the log file. Rails.application.config.filter_parameters += %i[ password passw secret token _key crypt salt certificate otp ssn key + _pem _ciphertext ]