From d4882aa64a7a483ec30ca61a507c2a6f5d3294f5 Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 3 Apr 2019 18:17:43 +0200 Subject: Export and import `hide_notifications` alongside user mutes (#10335) * Export hide_notifications along with user mutes * Import hide_notifications along with muted users list * Add headers for CSV exports --- app/models/export.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/models') diff --git a/app/models/export.rb b/app/models/export.rb index 9bf866d35..b35632c60 100644 --- a/app/models/export.rb +++ b/app/models/export.rb @@ -14,7 +14,11 @@ class Export end def to_muted_accounts_csv - to_csv account.muting.select(:username, :domain) + CSV.generate(headers: ['Account address', 'Hide notifications'], write_headers: true) do |csv| + account.mute_relationships.includes(:target_account).reorder(id: :desc).each do |mute| + csv << [acct(mute.target_account), mute.hide_notifications] + end + end end def to_following_accounts_csv -- cgit