module ActiveStorage::Reflection::ActiveRecordExtensions::ClassMethods
def reflect_on_all_attachments
attachment_reflections.values
end
Returns an array of reflection objects for all the attachments in the class.
def reflect_on_attachment(attachment)
attachment_reflections[attachment.to_s]
end
Returns the reflection object for the named attachment
.
User.reflect_on_attachment(:avatar)
© 2004–2019 David Heinemeier Hansson
Licensed under the MIT License.