Module: GdprAdmin::DataRetentionPolicyConcern

Extended by:
ActiveSupport::Concern
Included in:
DataRetentionPolicy
Defined in:
app/models/concerns/gdpr_admin/data_retention_policy_concern.rb

Instance Method Summary collapse

Instance Method Details

#process!Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/models/concerns/gdpr_admin/data_retention_policy_concern.rb', line 16

def process!
  with_lock do
    raise InvalidStatusError unless active?
    return unless should_process?

    Request.create!(
      tenant: tenant,
      requester: nil,
      request_type: :erase_data,
      data_older_than: period_in_days.days.ago,
    )
    update!(last_run_at: Time.now.utc)
  end
end

#should_process?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'app/models/concerns/gdpr_admin/data_retention_policy_concern.rb', line 31

def should_process?
  true
end