Skip to content

Commit 6cfd568

Browse files
skipkayhilp8
andauthored
Merge pull request rails#50892 from Takahashi-Seiji/main
Documentation: Expand documentation on has_one_attached method [ci-skip]. Co-authored-by: Petrik <[email protected]>
2 parents a7c68d4 + 2f5e052 commit 6cfd568

File tree

1 file changed

+8
-4
lines changed
  • activestorage/lib/active_storage/attached

1 file changed

+8
-4
lines changed

activestorage/lib/active_storage/attached/model.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ module Attached::Model
7474
# The system has been designed to having you go through the ActiveStorage::Attached::One
7575
# proxy that provides the dynamic proxy to the associations and factory methods, like +attach+.
7676
#
77-
# If the +:dependent+ option isn't set, the attachment will be purged
78-
# (i.e. destroyed) whenever the record is destroyed.
77+
# The +:dependent+ option defaults to +:purge_later+. This means the attachment will be
78+
# purged (i.e. destroyed) in the background whenever the record is destroyed.
79+
# If an ActiveJob::Backend queue adapter is not set in the application set it to
80+
# +purge+ instead.
7981
#
8082
# If you need the attachment to use a service which differs from the globally configured one,
8183
# pass the +:service+ option. For example:
@@ -172,8 +174,10 @@ def #{name}=(attachable)
172174
# The system has been designed to having you go through the ActiveStorage::Attached::Many
173175
# proxy that provides the dynamic proxy to the associations and factory methods, like +#attach+.
174176
#
175-
# If the +:dependent+ option isn't set, all the attachments will be purged
176-
# (i.e. destroyed) whenever the record is destroyed.
177+
# The +:dependent+ option defaults to +:purge_later+. This means the attachments will be
178+
# purged (i.e. destroyed) in the background whenever the record is destroyed.
179+
# If an ActiveJob::Backend queue adapter is not set in the application set it to
180+
# +purge+ instead.
177181
#
178182
# If you need the attachment to use a service which differs from the globally configured one,
179183
# pass the +:service+ option. For example:

0 commit comments

Comments
 (0)