Closed cmer closed 2 years ago
You can use customize
syntax (anonymize
is a sugar for it basically).
E.g. following snippet will add suffix -test
to values of key
key in data
column:
EvilSeed.configure do |config|
config.customize('User') do |attributes|
attributes['data'].merge!('key' => attributes['data']['key] + '-test')
end
end
Released version 0.3.0 in which you can also accept column value in anonymizer block and modify it like this:
EvilSeed.configure do |config|
config.anonymize("User")
metadata { |metadata| metadata&.merge("foo" => "bar") }
end
end
Enjoy!
This is awesome thank you!!!
One of my models has a JSONB column with attributes a few levels deep. What is the preferred way to clean up some of these attributes?