Methods

Instance Public methods

reflect_on_all_attachments()

Returns an array of reflection objects for all the attachments in the class.

📝 Source code
# File activestorage/lib/active_storage/reflection.rb, line 59
        def reflect_on_all_attachments
          attachment_reflections.values
        end
🔎 See on GitHub

reflect_on_attachment(attachment)

Returns the reflection object for the named attachment.

User.reflect_on_attachment(:avatar)
# => the avatar reflection
📝 Source code
# File activestorage/lib/active_storage/reflection.rb, line 68
        def reflect_on_attachment(attachment)
          attachment_reflections[attachment.to_s]
        end
🔎 See on GitHub