Sha256: a939b8d068cc7c802c48fe7fa6bb0d277e60c10299f2dc458284be7f943390f1

Contents?: true

Size: 451 Bytes

Versions: 71

Compression:

Stored size: 451 Bytes

Contents

# frozen_string_literal: true

module ActiveStorage
  class Attached::Changes::DetachMany # :nodoc:
    attr_reader :name, :record, :attachments

    def initialize(name, record, attachments)
      @name, @record, @attachments = name, record, attachments
    end

    def detach
      if attachments.any?
        attachments.delete_all if attachments.respond_to?(:delete_all)
        record.attachment_changes.delete(name)
      end
    end
  end
end

Version data entries

71 entries across 68 versions & 6 rubygems

Version Path
activestorage-7.2.0.rc1 lib/active_storage/attached/changes/detach_many.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activestorage-7.0.8.4/lib/active_storage/attached/changes/detach_many.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activestorage-7.1.3.4/lib/active_storage/attached/changes/detach_many.rb
activestorage-7.2.0.beta3 lib/active_storage/attached/changes/detach_many.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/activestorage-7.0.5.1/lib/active_storage/attached/changes/detach_many.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/activestorage-7.0.5.1/lib/active_storage/attached/changes/detach_many.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/activestorage-7.0.5.1/lib/active_storage/attached/changes/detach_many.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/activestorage-7.1.3.4/lib/active_storage/attached/changes/detach_many.rb
activestorage-7.2.0.beta2 lib/active_storage/attached/changes/detach_many.rb
activestorage-7.1.3.4 lib/active_storage/attached/changes/detach_many.rb
activestorage-7.0.8.4 lib/active_storage/attached/changes/detach_many.rb
activestorage-7.2.0.beta1 lib/active_storage/attached/changes/detach_many.rb
activestorage-7.1.3.2 lib/active_storage/attached/changes/detach_many.rb
activestorage-7.1.3.1 lib/active_storage/attached/changes/detach_many.rb
activestorage-7.0.8.1 lib/active_storage/attached/changes/detach_many.rb
activestorage-7.1.3 lib/active_storage/attached/changes/detach_many.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activestorage-7.0.3.1/lib/active_storage/attached/changes/detach_many.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activestorage-7.0.2.3/lib/active_storage/attached/changes/detach_many.rb
activestorage-7.1.2 lib/active_storage/attached/changes/detach_many.rb
activestorage-7.1.1 lib/active_storage/attached/changes/detach_many.rb