mirror of
https://github.com/docusealco/docuseal
synced 2026-11-08 07:42:32 -05:00
remove replace_timestamps helper
This commit is contained in:
1 parent
6dd4382446
commit
4635fdd32b
10 files changed
+72
-88
No files matched your search
@@ -67,19 +67,3 @@ 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
|
||||
Reference in new issue
Block a user