Sha256: c9cfc8026f37d377c5accb8fb9a9e5ce0c4e398cb2c29f8bb6bbadbf41f66185

Contents?: true

Size: 410 Bytes

Versions: 5

Compression:

Stored size: 410 Bytes

Contents

# frozen_string_literal: true

require "models/destroy_async_parent_soft_delete"

class DlKeyedBelongsToSoftDelete < ActiveRecord::Base
  belongs_to :destroy_async_parent_soft_delete,
    dependent: :destroy_async,
    ensuring_owner_was: :deleted?,
    class_name: "DestroyAsyncParentSoftDelete"

  def deleted?
    deleted
  end

  def destroy
    update(deleted: true)
    run_callbacks(:destroy)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ibm_db-5.5.0 test/models/dl_keyed_belongs_to_soft_delete.rb
ibm_db-5.4.1 test/models/dl_keyed_belongs_to_soft_delete.rb
ibm_db-5.4.0 test/models/dl_keyed_belongs_to_soft_delete.rb
ibm_db-5.3.2 test/models/dl_keyed_belongs_to_soft_delete.rb
ibm_db-5.3.1 test/models/dl_keyed_belongs_to_soft_delete.rb