* uploads.media_asset_count - the number of media assets attached to this upload. * upload_media_assets.status - the status of each media asset attached to this upload (processing, active, failed) * upload_media_assets.source_url - the source of each media asset attached to this upload * upload_media_assets.error - the error message if uploading the media asset failed
19 lines
403 B
Ruby
19 lines
403 B
Ruby
# frozen_string_literal: true
|
|
|
|
class UploadMediaAsset < ApplicationRecord
|
|
belongs_to :upload
|
|
belongs_to :media_asset
|
|
|
|
enum status: {
|
|
pending: 0,
|
|
processing: 100,
|
|
active: 200,
|
|
failed: 300,
|
|
}
|
|
|
|
def self.search(params)
|
|
q = search_attributes(params, :id, :created_at, :updated_at, :status, :source_url, :error, :upload, :media_asset)
|
|
q.apply_default_order(params)
|
|
end
|
|
end
|