https://avo.cool logo
Anonymizing fields + Monkey Patching issue
# avo-2
l
Hello Avocados, I'm working on a solution to anonymize information on the resource screens, and started planning around having a new attribute for the resource where I would add the symbol IDs of the fields that should be anonymized. The new attribute part I could implement by monkey patching Avo::Resources::Base, but I'm hitting a snag here because I can't seem able to monkey patch the fill record method or any other method there. Anyone has stumbled on something like this?
Copy code
# frozen_string_literal: true

module Avo
  module Resources
    class Base
      class_attribute :anonymized_fields, default: []
    end
  end
end
Every time I try and override the fill record method for instance, it's simply ignored and goes straight to the regular method
m
Thread automatically created by DD in #740893011994738751
l
Hi @lively-knife-78496, could you please share the source line of what method are you trying to override and how are you overriding it?
3 Views