Class: ActiveStorage::Attached::Changes::DeleteOne
- Inherits:
-
Object
- Object
- ActiveStorage::Attached::Changes::DeleteOne
- Defined in:
- lib/active_storage/attached/changes/delete_one.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
- #attachment ⇒ Object
-
#initialize(name, record) ⇒ DeleteOne
constructor
A new instance of DeleteOne.
- #save ⇒ Object
Constructor Details
#initialize(name, record) ⇒ DeleteOne
Returns a new instance of DeleteOne.
7 8 9 |
# File 'lib/active_storage/attached/changes/delete_one.rb', line 7 def initialize(name, record) @name, @record = name, record end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/active_storage/attached/changes/delete_one.rb', line 5 def name @name end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
5 6 7 |
# File 'lib/active_storage/attached/changes/delete_one.rb', line 5 def record @record end |
Instance Method Details
#attachment ⇒ Object
11 12 13 |
# File 'lib/active_storage/attached/changes/delete_one.rb', line 11 def nil end |
#save ⇒ Object
15 16 17 |
# File 'lib/active_storage/attached/changes/delete_one.rb', line 15 def save record.public_send("#{name}_attachment=", nil) end |