about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-04-08 07:28:27 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-04-08 07:28:27 +0200
commitcb71c95e2292730befb8e12cf3b05d09d3e7443b (patch)
treeb9fb7713050f3a898c9b3358d017093a09abf7ae /app/models
parent619bbc23ef15ab32065dda67b461abfe6a71efe8 (diff)
Export and import show_reblogs together with following list (#10495)
* Refactor imports

* Export show_reblogs when exporting list of followed users

* Add support for importing show_reblogs with following collection

* Fix tests
Diffstat (limited to 'app/models')
-rw-r--r--app/models/export.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/export.rb b/app/models/export.rb
index b35632c60..cab01f11a 100644
--- a/app/models/export.rb
+++ b/app/models/export.rb
@@ -22,7 +22,11 @@ class Export
   end
 
   def to_following_accounts_csv
-    to_csv account.following.select(:username, :domain)
+    CSV.generate(headers: ['Account address', 'Show boosts'], write_headers: true) do |csv|
+      account.active_relationships.includes(:target_account).reorder(id: :desc).each do |follow|
+        csv << [acct(follow.target_account), follow.show_reblogs]
+      end
+    end
   end
 
   def to_lists_csv