Class: MobilityActiveStorage::Backend

Inherits:
Object
  • Object
show all
Includes:
Mobility::Backend, BackendMethods
Defined in:
lib/mobility_active_storage/backend.rb,
sig/mobility_active_storage.rbs

Overview

Mobility backend for a single translated Active Storage attachment.

Examples:

class Product < ApplicationRecord
  extend Mobility
  translates :document, backend: :active_storage
end

product.document.attach(io: file, filename: "en.pdf", content_type: "application/pdf")
Mobility.with_locale(:fr) { product.document.attach(...) }

Method Summary

Methods included from BackendMethods

#attached, #each_locale, included, #present?, #read, #write