Skip to content

Commit

Permalink
Fix /admin/accounts/:account_id/statuses/:id for edited posts with …
Browse files Browse the repository at this point in the history
…media attachments (mastodon#30819)
  • Loading branch information
ClearlyClaire authored Jun 24, 2024
1 parent 47bae57 commit e38d9e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/status_edit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PreservedMediaAttachment < ActiveModelSerializers::Model
scope :ordered, -> { order(id: :asc) }

delegate :local?, :application, :edited?, :edited_at,
:discarded?, :visibility, to: :status
:discarded?, :visibility, :language, to: :status

def emojis
return @emojis if defined?(@emojis)
Expand Down
5 changes: 5 additions & 0 deletions spec/controllers/admin/statuses_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@

describe 'GET #show' do
before do
status.media_attachments << Fabricate(:media_attachment, type: :image, account: status.account)
status.save!
status.snapshot!(at_time: status.created_at, rate_limit: false)
status.update!(text: 'Hello, this is an edited post')
status.snapshot!(rate_limit: false)
get :show, params: { account_id: account.id, id: status.id }
end

Expand Down

0 comments on commit e38d9e0

Please sign in to comment.