|
|
@ -206,10 +206,12 @@ class MediaAttachment < ApplicationRecord
|
|
|
|
|
|
|
|
|
|
|
|
scope :attached, -> { where.not(status_id: nil).or(where.not(scheduled_status_id: nil)) }
|
|
|
|
scope :attached, -> { where.not(status_id: nil).or(where.not(scheduled_status_id: nil)) }
|
|
|
|
scope :cached, -> { remote.where.not(file_file_name: nil) }
|
|
|
|
scope :cached, -> { remote.where.not(file_file_name: nil) }
|
|
|
|
|
|
|
|
scope :created_before, ->(value) { where(arel_table[:created_at].lt(value)) }
|
|
|
|
scope :local, -> { where(remote_url: '') }
|
|
|
|
scope :local, -> { where(remote_url: '') }
|
|
|
|
scope :ordered, -> { order(id: :asc) }
|
|
|
|
scope :ordered, -> { order(id: :asc) }
|
|
|
|
scope :remote, -> { where.not(remote_url: '') }
|
|
|
|
scope :remote, -> { where.not(remote_url: '') }
|
|
|
|
scope :unattached, -> { where(status_id: nil, scheduled_status_id: nil) }
|
|
|
|
scope :unattached, -> { where(status_id: nil, scheduled_status_id: nil) }
|
|
|
|
|
|
|
|
scope :updated_before, ->(value) { where(arel_table[:updated_at].lt(value)) }
|
|
|
|
|
|
|
|
|
|
|
|
attr_accessor :skip_download
|
|
|
|
attr_accessor :skip_download
|
|
|
|
|
|
|
|
|
|
|
|