REFACTOR: Clean up parameterized title

REFACTOR: Clean up parameterized title

Follow up to FIX: Empty backup names with unicode site titles

  • Use .presence - “It’s cleaner”
  • Update spec to use System.system_user so it is more readable
diff --git a/lib/backup_restore/backuper.rb b/lib/backup_restore/backuper.rb
index 4eb0c98..d93ac58 100644
--- a/lib/backup_restore/backuper.rb
+++ b/lib/backup_restore/backuper.rb
@@ -84,7 +84,7 @@ module BackupRestore
     end
 
     def get_parameterized_title
-      SiteSetting.title.parameterize.empty? ? "discourse" : SiteSetting.title.parameterize
+      SiteSetting.title.parameterize.presence || "discourse"
     end
 
     def initialize_state
diff --git a/q b/q
new file mode 100644
index 0000000..4510207
--- /dev/null
+++ b/q
@@ -0,0 +1,158 @@
+                  List of relations
+ Schema |            Name             | Type  | Owner 
+--------+-----------------------------+-------+-------
+ public | anonymous_users             | table | blake
+ public | api_keys                    | table | blake
+ public | application_requests        | table | blake
+ public | ar_internal_metadata        | table | blake
+ public | backup_metadata             | table | blake
+ public | badge_groupings             | table | blake
+ public | badge_types                 | table | blake
+ public | badges                      | table | blake
+ public | categories                  | table | blake
+ public | categories_web_hooks        | table | blake
+ public | category_custom_fields      | table | blake
+ public | category_featured_topics    | table | blake
+ public | category_groups             | table | blake
+ public | category_search_data        | table | blake
+ public | category_tag_groups         | table | blake
+ public | category_tag_stats          | table | blake
+ public | category_tags               | table | blake
+ public | category_users              | table | blake
+ public | child_themes                | table | blake
+ public | color_scheme_colors         | table | blake
+ public | color_schemes               | table | blake
+ public | custom_emojis               | table | blake
+ public | developers                  | table | blake
+ public | directory_items             | table | blake
+ public | draft_sequences             | table | blake
+ public | drafts                      | table | blake
+ public | email_change_requests       | table | blake
+ public | email_logs                  | table | blake
+ public | email_tokens                | table | blake
+ public | embeddable_hosts            | table | blake
+ public | github_commits              | table | blake
+ public | github_repos                | table | blake
+ public | github_user_infos           | table | blake
+ public | given_daily_likes           | table | blake
+ public | google_user_infos           | table | blake
+ public | group_archived_messages     | table | blake
+ public | group_custom_fields         | table | blake
+ public | group_histories             | table | blake
+ public | group_mentions              | table | blake
+ public | group_requests              | table | blake
+ public | group_users                 | table | blake
+ public | groups                      | table | blake
+ public | groups_web_hooks            | table | blake
+ public | ignored_users               | table | blake
+ public | incoming_domains            | table | blake
+ public | incoming_emails             | table | blake
+ public | incoming_links              | table | blake
+ public | incoming_referers           | table | blake
+ public | instagram_user_infos        | table | blake
+ public | invited_groups              | table | blake
+ public | invites                     | table | blake
+ public | javascript_caches           | table | blake
+ public | message_bus                 | table | blake
+ public | muted_users                 | table | blake
+ public | notifications               | table | blake
+ public | oauth2_user_infos           | table | blake
+ public | onceoff_logs                | table | blake
+ public | optimized_images            | table | blake
+ public | permalinks                  | table | blake
+ public | plugin_store_rows           | table | blake
+ public | poll_options                | table | blake
+ public | poll_votes                  | table | blake
+ public | polls                       | table | blake
+ public | post_action_types           | table | blake
+ public | post_actions                | table | blake
+ public | post_custom_fields          | table | blake
+ public | post_details                | table | blake
+ public | post_replies                | table | blake
+ public | post_reply_keys             | table | blake
+ public | post_revisions              | table | blake
+ public | post_search_data            | table | blake
+ public | post_stats                  | table | blake
+ public | post_timings                | table | blake
+ public | post_uploads                | table | blake
+ public | posts                       | table | blake
+ public | push_subscriptions          | table | blake
+ public | quoted_posts                | table | blake
+ public | remote_themes               | table | blake
+ public | reviewable_claimed_topics   | table | blake
+ public | reviewable_histories        | table | blake
+ public | reviewable_scores           | table | blake
+ public | reviewables                 | table | blake
+ public | scheduler_stats             | table | blake
+ public | schema_migration_details    | table | blake
+ public | schema_migrations           | table | blake
+ public | screened_emails             | table | blake
+ public | screened_ip_addresses       | table | blake
+ public | screened_urls               | table | blake
+ public | search_logs                 | table | blake
+ public | shared_drafts               | table | blake
+ public | single_sign_on_records      | table | blake
+ public | site_settings               | table | blake
+ public | skipped_email_logs          | table | blake
+ public | stylesheet_cache            | table | blake
+ public | tag_group_memberships       | table | blake
+ public | tag_group_permissions       | table | blake
+ public | tag_groups                  | table | blake
+ public | tag_search_data             | table | blake
+ public | tag_users                   | table | blake
+ public | tags                        | table | blake
+ public | tags_web_hooks              | table | blake
+ public | theme_fields                | table | blake
+ public | theme_settings              | table | blake
+ public | theme_translation_overrides | table | blake
+ public | themes                      | table | blake
+ public | top_topics                  | table | blake
+ public | topic_allowed_groups        | table | blake
+ public | topic_allowed_users         | table | blake
+ public | topic_custom_fields         | table | blake
+ public | topic_embeds                | table | blake
+ public | topic_invites               | table | blake
+ public | topic_link_clicks           | table | blake
+ public | topic_links                 | table | blake
+ public | topic_search_data           | table | blake
+ public | topic_tags                  | table | blake
+ public | topic_timers                | table | blake
+ public | topic_users                 | table | blake
+ public | topic_views                 | table | blake
+ public | topics                      | table | blake
+ public | translation_overrides       | table | blake
+ public | unsubscribe_keys            | table | blake
+ public | uploads                     | table | blake
+ public | user_actions                | table | blake
+ public | user_api_keys               | table | blake
+ public | user_archived_messages      | table | blake
+ public | user_associated_accounts    | table | blake
+ public | user_auth_token_logs        | table | blake
+ public | user_auth_tokens            | table | blake
+ public | user_avatars                | table | blake
+ public | user_badges                 | table | blake
+ public | user_custom_fields          | table | blake
+ public | user_emails                 | table | blake
+ public | user_exports                | table | blake

[... diff too long, it was truncated ...]

GitHub sha: b0c92bb0

1 Like

Remove file.