123456789_123456789_123456789_123456789_123456789_

Class: ActiveStorage::Attached::Changes::DeleteOne

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: activestorage/lib/active_storage/attached/changes/delete_one.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(name, record) ⇒ DeleteOne

[ GitHub ]

  
# File 'activestorage/lib/active_storage/attached/changes/delete_one.rb', line 7

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

Instance Attribute Details

#name (readonly)

[ GitHub ]

  
# File 'activestorage/lib/active_storage/attached/changes/delete_one.rb', line 5

attr_reader :name, :record

#record (readonly)

[ GitHub ]

  
# File 'activestorage/lib/active_storage/attached/changes/delete_one.rb', line 5

attr_reader :name, :record

Instance Method Details

#attachment

[ GitHub ]

  
# File 'activestorage/lib/active_storage/attached/changes/delete_one.rb', line 11

def attachment
  nil
end

#save

[ GitHub ]

  
# File 'activestorage/lib/active_storage/attached/changes/delete_one.rb', line 15

def save
  record.public_send("#{name}_attachment=", nil)
end