Sha256: 8909e4a3e459fb8bea6e2d1dba621f7e8777dbd724f1b536158327f6d2a64160
Contents?: true
Size: 453 Bytes
Versions: 5
Compression:
Stored size: 453 Bytes
Contents
# frozen_string_literal: true class DestroyAsyncParentSoftDelete < ActiveRecord::Base has_many :taggings, as: :taggable, class_name: "Tagging" has_many :tags, through: :taggings, dependent: :destroy_async, ensuring_owner_was: :deleted? has_one :dl_keyed_has_one, dependent: :destroy_async, ensuring_owner_was: :deleted? def deleted? deleted end def destroy update(deleted: true) run_callbacks(:destroy) end end
Version data entries
5 entries across 5 versions & 1 rubygems