Sha256: 10cb8db4f0274289b8d7f70f8b12997e368dbcb7dd9a5419f6554ea7e793da8c

Contents?: true

Size: 335 Bytes

Versions: 3

Compression:

Stored size: 335 Bytes

Contents

module CurationConcern
  module WithLinkedResources
    extend ActiveSupport::Concern

    included do
      has_many :linked_resources, property: :is_part_of

      after_destroy :after_destroy_cleanup_linked_resources
    end

    def after_destroy_cleanup_linked_resources
      linked_resources.each(&:destroy)
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
curate-0.5.1 app/repository_models/curation_concern/with_linked_resources.rb
curate-0.5.0 app/repository_models/curation_concern/with_linked_resources.rb
curate-0.4.2 app/repository_models/curation_concern/with_linked_resources.rb