Method: ActiveStorage::Reflection::ActiveRecordExtensions::ClassMethods#reflect_on_attachment

Defined in:
activestorage/lib/active_storage/reflection.rb

#reflect_on_attachment(attachment) ⇒ Object

Returns the reflection object for the named attachment.

User.reflect_on_attachment(:avatar)
# => the avatar reflection


68
69
70
# File 'activestorage/lib/active_storage/reflection.rb', line 68

def reflect_on_attachment(attachment)
  attachment_reflections[attachment.to_s]
end