Sha256: 39484fa2fde0e0c0330ba060e2fb8c4575aa31b81b04d01fc0d4fda8695dcce7

Contents?: true

Size: 643 Bytes

Versions: 4

Compression:

Stored size: 643 Bytes

Contents

# frozen_string_literal: true

require 'active_record'

module LoggableActivity
  # This class represends an additional data owner for a record.
  # For it to kick in, the data_owner configuration has to be set to true in the loggable_activity.yaml file.
  class DataOwner < ActiveRecord::Base
    self.table_name = 'loggable_data_owners'
    belongs_to :record, polymorphic: true, optional: true
    belongs_to :encryption_key, class_name: '::LoggableActivity::EncryptionKey'

    # When a record is deleted, all data owner added to the record is also deleted.
    def mark_as_deleted!
      encryption_key.mark_as_deleted!
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
loggable_activity-0.2.1c lib/loggable_activity/data_owner.rb
loggable_activity-0.2.1 lib/loggable_activity/data_owner.rb
loggable_activity-0.1.59 lib/loggable_activity/data_owner.rb
loggable_activity-0.1.58 lib/loggable_activity/data_owner.rb