Fix: 画像の並び順が変わる場合 (#339)

* Fix: 画像の並び順が変わる場合

* Fix
This commit is contained in:
KMY(雪あすか) 2023-12-09 10:19:54 +09:00 committed by GitHub
parent dccc7c9b3a
commit 6edb8bd9e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,7 +83,7 @@ class Status < ApplicationRecord
has_many :replies, foreign_key: 'in_reply_to_id', class_name: 'Status', inverse_of: :thread, dependent: nil
has_many :mentions, dependent: :destroy, inverse_of: :status
has_many :mentioned_accounts, through: :mentions, source: :account, class_name: 'Account'
has_many :media_attachments, dependent: :nullify
has_many :media_attachments, -> { order('id asc') }, dependent: :nullify, inverse_of: false
has_many :reference_objects, class_name: 'StatusReference', inverse_of: :status, dependent: :destroy
has_many :references, through: :reference_objects, class_name: 'Status', source: :target_status
has_many :referenced_by_status_objects, foreign_key: 'target_status_id', class_name: 'StatusReference', inverse_of: :target_status, dependent: :destroy