module Ckeditor::Backend::ActiveStorage::InstanceMethods

Public Instance Methods

content_type() click to toggle source
# File lib/ckeditor/backend/active_storage.rb, line 37
def content_type
  self.storage_data.content_type
end
content_type=(_content_type) click to toggle source
# File lib/ckeditor/backend/active_storage.rb, line 40
def content_type=(_content_type)
  self.storage_data.content_type = _content_type
end
path() click to toggle source
# File lib/ckeditor/backend/active_storage.rb, line 30
def path
  rails_blob_path(self.storage_data, only_path: true)
end
styles() click to toggle source
# File lib/ckeditor/backend/active_storage.rb, line 34
def styles
end
url() click to toggle source
# File lib/ckeditor/backend/active_storage.rb, line 26
def url
  rails_blob_path(self.storage_data, only_path: true)
end

Protected Instance Methods

apply_data() click to toggle source
# File lib/ckeditor/backend/active_storage.rb, line 53
def apply_data
  if data.is_a?(Ckeditor::Http::QqFile)
    storage_data.attach(io: data, filename: data.original_filename)
  else
    storage_data.attach(data)
  end

  self.data_file_name = storage_data.blob.filename
  self.data_content_type = storage_data.blob.content_type
  self.data_file_size = storage_data.blob.byte_size
end
blob() click to toggle source
# File lib/ckeditor/backend/active_storage.rb, line 49
def blob
  @blob ||= ::ActiveStorage::Blob.find(file.attachment.blob_id)
end
file() click to toggle source
# File lib/ckeditor/backend/active_storage.rb, line 45
def file
  @file ||= storage_data
end