跳到內容 跳到搜尋
方法
R

實例公開方法

reflect_on_all_attachments()

傳回陣列,內含類別中所有附掛項目的反射物件。

# File activestorage/lib/active_storage/reflection.rb, line 59
def reflect_on_all_attachments
  attachment_reflections.values
end

reflect_on_attachment(attachment)

傳回名為 attachment 的反射物件。

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