Module: GdprAdmin::Helpers::DataPolicyHelper

Included in:
ApplicationDataPolicy
Defined in:
lib/gdpr_admin/helpers/data_policy_helper.rb

Instance Method Summary collapse

Instance Method Details

#model_data_policy_class(model) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/gdpr_admin/helpers/data_policy_helper.rb', line 14

def model_data_policy_class(model)
  model = model.constantize if model.is_a?(String)
  return model.data_policy_class if model.respond_to?(:data_policy_class)

  prefix = model.data_policy_prefix if model.respond_to?(:data_policy_prefix)
  "#{prefix}#{model}DataPolicy".constantize
rescue NameError
  nil
end

#skip_data_policy!Object



6
7
8
# File 'lib/gdpr_admin/helpers/data_policy_helper.rb', line 6

def skip_data_policy!
  raise SkipDataPolicyError
end

#skip_record!Object

Raises:



10
11
12
# File 'lib/gdpr_admin/helpers/data_policy_helper.rb', line 10

def skip_record!
  raise SkipRecordError
end