def set_deleted_at(value, force = nil)
      return self unless is_permanent?
      record = get_deleted_record
      record.deleted_at = value
      begin
        # we call save! instead of update_attribute so an
        # ActiveRecord::RecordInvalid error will be raised if the record isn't
        # valid. (This prevents reviving records that disregard validation
        # constraints,)
        if PermanentRecords.should_ignore_validations?(force)
          record.save(validate: false)
        else
          record.save!
        end

        @attributes = record.instance_variable_get('@attributes')
      rescue => e
        # trigger dependent record destruction (they were revived before this
        # record, which cannot be revived due to validations)
        record.destroy
        raise e
      end
    end
def set_deleted_at(value, force = nil)
      return self unless is_permanent?
      record = get_deleted_record
      record.deleted_at = value
      begin
        # we call save! instead of update_attribute so an
        # ActiveRecord::RecordInvalid error will be raised if the record isn't
        # valid. (This prevents reviving records that disregard validation
        # constraints,)
        if PermanentRecords.should_ignore_validations?(force)
          record.save(validate: false)
        else
          record.save!
        end

        @attributes = record.instance_variable_get('@attributes')
      rescue => e
        # trigger dependent record destruction (they were revived before this
        # record, which cannot be revived due to validations)
        record.destroy
        raise e
      end
    end
rubocop:disable Metrics/MethodLength