Class: Eluvia::File
- Includes:
- ActiveModel::Model, ActiveModel::Attributes, AttachmentHelper
- Defined in:
- lib/eluvia/models/file.rb
Constant Summary
Constants included from ActiveModel::Attributes
ActiveModel::Attributes::COMPLEX_TYPES, ActiveModel::Attributes::SIMPLE_TYPES
Class Method Summary collapse
-
.from_active_storage_attachment(attachment, **options) ⇒ Object
*********************************************************************** Constructor from attachment ***********************************************************************.
Methods included from AttachmentHelper
Methods included from ActiveModel::Attributes
#initialize, #new_record?, #read_attribute, #write_attribute
Class Method Details
.from_active_storage_attachment(attachment, **options) ⇒ Object
Constructor from attachment
34 35 36 37 38 39 40 41 |
# File 'lib/eluvia/models/file.rb', line 34 def self.(, **) new( type: .content_type, url: (, **), filename: .filename, size: .byte_size ) end |