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