diff --git a/app/controllers/admin/media_attachments_controller.rb b/app/controllers/admin/media_attachments_controller.rb index 35de41d89b..9d6927a39d 100644 --- a/app/controllers/admin/media_attachments_controller.rb +++ b/app/controllers/admin/media_attachments_controller.rb @@ -12,7 +12,7 @@ module Admin private def filtered_attachments - MediaAttachment.recently_attachments + MediaAttachment.local_attached.order(created_at: :desc) end end end diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 4902026c5e..f390d87aaf 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -209,7 +209,7 @@ class MediaAttachment < ApplicationRecord scope :local, -> { where(remote_url: '') } scope :remote, -> { where.not(remote_url: '') } scope :cached, -> { remote.where.not(file_file_name: nil) } - scope :recently_attachments, -> { attached.where(remote_url: '').order(status_id: 'DESC') } + scope :local_attached, -> { attached.where(remote_url: '') } default_scope { order(id: :asc) }