aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib/active_storage/attached.rb
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2017-08-29 15:34:50 -0400
committerGeorge Claghorn <george@basecamp.com>2017-08-29 15:34:50 -0400
commit656ee8b2dd1b06541f03ea19302d3529085f5139 (patch)
tree969368cc54572a6dc30579a300beaa53f8d938c7 /activestorage/lib/active_storage/attached.rb
parent96742b5e0f04a2ed795032df04736cb1f16cc3a4 (diff)
downloadrails-656ee8b2dd1b06541f03ea19302d3529085f5139.tar.gz
rails-656ee8b2dd1b06541f03ea19302d3529085f5139.tar.bz2
rails-656ee8b2dd1b06541f03ea19302d3529085f5139.zip
Fix replacing a singular attachment
Diffstat (limited to 'activestorage/lib/active_storage/attached.rb')
-rw-r--r--activestorage/lib/active_storage/attached.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activestorage/lib/active_storage/attached.rb b/activestorage/lib/active_storage/attached.rb
index 9c4b6d5d1d..c08fd56652 100644
--- a/activestorage/lib/active_storage/attached.rb
+++ b/activestorage/lib/active_storage/attached.rb
@@ -8,10 +8,10 @@ module ActiveStorage
# Abstract base class for the concrete ActiveStorage::Attached::One and ActiveStorage::Attached::Many
# classes that both provide proxy access to the blob association for a record.
class Attached
- attr_reader :name, :record
+ attr_reader :name, :record, :dependent
- def initialize(name, record)
- @name, @record = name, record
+ def initialize(name, record, dependent:)
+ @name, @record, @dependent = name, record, dependent
end
private