5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-25 03:56:22 +00:00

fix: no filtrar información privada en YAML.dump

This commit is contained in:
f 2024-05-02 18:49:29 -03:00
parent 368cb065ea
commit 330e82041b
No known key found for this signature in database

View file

@ -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