Skip to content

Commit 41b1fac

Browse files
committed
Clarify ActiveStorage::Attached::Model docs [ci skip]
1 parent c0effe0 commit 41b1fac

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
@@ -71,8 +71,10 @@ module Attached::Model
7171
# and +avatar_blob+. But you shouldn't need to work with these associations directly in
7272
# most circumstances.
7373
#
74-
# The system has been designed to having you go through the ActiveStorage::Attached::One
75-
# proxy that provides the dynamic proxy to the associations and factory methods, like +attach+.
74+
# Instead, +has_one_attached+ generates an ActiveStorage::Attached::One proxy to
75+
# provide access to the associations and factory methods, like +attach+:
76+
#
77+
# user.avatar.attach(uploaded_file)
7678
#
7779
# The +:dependent+ option defaults to +:purge_later+. This means the attachment will be
7880
# purged (i.e. destroyed) in the background whenever the record is destroyed.
@@ -171,8 +173,10 @@ def #{name}=(attachable)
171173
# and +photos_blobs+. But you shouldn't need to work with these associations directly in
172174
# most circumstances.
173175
#
174-
# The system has been designed to having you go through the ActiveStorage::Attached::Many
175-
# proxy that provides the dynamic proxy to the associations and factory methods, like +#attach+.
176+
# Instead, +has_one_attached+ generates an ActiveStorage::Attached::Many proxy to
177+
# provide access to the associations and factory methods, like +attach+:
178+
#
179+
# user.photos.attach(uploaded_file)
176180
#
177181
# The +:dependent+ option defaults to +:purge_later+. This means the attachments will be
178182
# purged (i.e. destroyed) in the background whenever the record is destroyed.

0 commit comments

Comments
 (0)