2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-10-27 04:29:36 +08:00
|
|
|
desc 'Export all the categories'
|
2017-11-11 21:22:22 +08:00
|
|
|
task 'export:categories', [:category_ids] => [:environment] do |_, args|
|
2019-10-23 14:27:14 +08:00
|
|
|
require "import_export"
|
2018-05-28 21:49:26 +08:00
|
|
|
ids = args[:category_ids].split(" ")
|
2017-10-27 04:29:36 +08:00
|
|
|
|
2018-05-28 21:51:06 +08:00
|
|
|
ImportExport.export_categories(ids)
|
2017-11-11 21:22:22 +08:00
|
|
|
puts "", "Done", ""
|
|
|
|
end
|
|
|
|
|
|
|
|
desc 'Export only the structure of all categories'
|
|
|
|
task 'export:category_structure', [:include_group_users, :file_name] => [:environment] do |_, args|
|
2019-10-23 14:27:14 +08:00
|
|
|
require "import_export"
|
2017-11-11 21:22:22 +08:00
|
|
|
|
|
|
|
ImportExport.export_category_structure(args[:include_group_users], args[:file_name])
|
2017-10-27 04:29:36 +08:00
|
|
|
puts "", "Done", ""
|
|
|
|
end
|
2020-04-18 05:59:54 +08:00
|
|
|
|
|
|
|
desc 'Export all user groups'
|
|
|
|
task 'export:groups', [:include_group_users, :file_name] => [:environment] do |_, args|
|
|
|
|
require "import_export"
|
|
|
|
|
|
|
|
ImportExport.export_groups(args[:include_group_users], args[:file_name])
|
|
|
|
puts "", "Done", ""
|
|
|
|
end
|
2022-10-06 03:22:16 +08:00
|
|
|
|
|
|
|
desc 'Export all translation overrides'
|
|
|
|
task 'export:translation_overrides' => [:environment] do |_, args|
|
|
|
|
require "import_export"
|
|
|
|
|
|
|
|
ImportExport.export_translation_overrides
|
|
|
|
puts "", "Done", ""
|
|
|
|
end
|