From 330e82041bbd4d6fc1831ba7234e4ed149aff0d3 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 2 May 2024 18:49:29 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20no=20filtrar=20informaci=C3=B3n=20privad?= =?UTF-8?q?a=20en=20YAML.dump?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/application_record.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/models/application_record.rb b/app/models/application_record.rb index f09c4dd4..6662ddeb 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -7,6 +7,23 @@ class ApplicationRecord < ActiveRecord::Base # # @return [String] def to_yaml(options = {}) - self.class.inspection_filter.filter(serializable_hash).to_yaml(options) + pruned_attributes.to_yaml(options) + end + + # Devuelve todos los atributos menos los filtrados + # + # @return [Hash] + def pruned_attributes + self.class.inspection_filter.filter(serializable_hash) + end + + # @param coder [Psych::Coder] + # @return nil + def encode_with(coder) + pruned_attributes.each_pair do |attr, value| + coder[attr] = value + end + + nil end end