0
0
Fork 0

Fix #323 - self-replies to appear in public timelines again

This commit is contained in:
Eugen Rochko 2016-12-02 14:33:20 +01:00
parent e3222feddb
commit 3114e55c7a
4 changed files with 30 additions and 14 deletions

View file

@ -0,0 +1,18 @@
class AddInReplyToAccountIdToStatuses < ActiveRecord::Migration[5.0]
def up
add_column :statuses, :in_reply_to_account_id, :integer, null: true, default: nil
ActiveRecord::Base.transaction do
Status.where.not(in_reply_to_id: nil).includes(:thread).find_each do |status|
next if status.thread.nil?
status.in_reply_to_account_id = status.thread.account_id
status.save!
end
end
end
def down
remove_column :statuses, :in_reply_to_account_id
end
end