модуль ActiveStorage::Reflection::ActiveRecordExtensions::ClassMethods
Публичные методы экземпляров
# File activestorage/lib/active_storage/reflection.rb, line 59 def reflect_on_all_attachments attachment_reflections.values end
Возвращает массив объектов рефлексии для всех вложений в классе.
# File activestorage/lib/active_storage/reflection.rb, line 68 def reflect_on_attachment(attachment) attachment_reflections[attachment.to_s] end
Возвращает объект рефлексии для указанного attachment.
User.reflect_on_attachment(:avatar) # => the avatar reflection
© 2004–2021 David Heinemeier Hansson
Licensed under the MIT License.