use webhook urls instead of encrypted configs

This commit is contained in:
Alex Turchyn authored and Pete Matsyburka committed 2024-11-02 22:12:41 +02:00
1 parent f669045362
commit 84edb6dbda
50 files changed
+1350 -269

No files matched your search

+16
View File
@@ -67,3 +67,19 @@ RSpec.configure do |config|
Sidekiq::Testing.inline! if example.metadata[:sidekiq] == :inline
end
end
def replace_timestamps(data, replace = /.*/)
timestamp_fields = %w[created_at updated_at completed_at sent_at opened_at timestamp]
data.each do |key, value|
if timestamp_fields.include?(key) && (value.is_a?(String) || value.is_a?(Time))
data[key] = replace
elsif value.is_a?(Hash)
replace_timestamps(value)
elsif value.is_a?(Array)
value.each { |item| replace_timestamps(item) if item.is_a?(Hash) }
end
end
data
end