Class: ActiveStorageSupport::Base64Many

Inherits:
ActiveStorage::Attached::Many
  • Object
show all
Defined in:
lib/active_storage_support/base64_many.rb

Instance Method Summary collapse

Instance Method Details

#attach(*attachables) ⇒ Object



3
4
5
# File 'lib/active_storage_support/base64_many.rb', line 3

def attach(*attachables)
  super base64_attachments(attachables)
end

#base64_attachments(attachments) ⇒ Object



7
8
9
10
11
# File 'lib/active_storage_support/base64_many.rb', line 7

def base64_attachments(attachments)
  attachments.flatten.map do |attachment|
    ActiveStorageSupport::Base64Attach.attachment_from_data(attachment)
  end
end