Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/tasks/audits.rake
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ namespace :audits do

def get_audits_without_templates
User.as_anonymous_admin do
Audited::Audit.up_until(before_date).where.not(auditable_type: %w(ReportTemplate Ptable ProvisioningTemplate JobTemplate))
if ENV.key?('AUDITS_PURGE_INCLUDE_TEMPLATES')
Audited::Audit.up_until(before_date)
else
Audited::Audit.up_until(before_date).where.not(auditable_type: %w(ReportTemplate Ptable ProvisioningTemplate JobTemplate))
end
end
end

Expand Down
Loading