From c6a313d4584d98efae7d9921cd5f957ca7319586 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 10 Jul 2014 11:28:49 -0400 Subject: [PATCH] Seed categories with capitalized names --- config/locales/server.en.yml | 6 +++--- db/fixtures/001_categories.rb | 4 ++-- db/migrate/20131022045114_add_uncategorized_category.rb | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 76f55cf44fd..96417c6e12f 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -225,13 +225,13 @@ en: no_info_me: "
the About Me field of your profile is currently blank, would you like to fill it out?
" no_info_other: "
%{name} hasn't entered anything in the About Me field of their profile yet
" - vip_category_name: "lounge" + vip_category_name: "Lounge" vip_category_description: "A category exclusive to members with trust level 3 and higher." - meta_category_name: "meta" + meta_category_name: "Meta" meta_category_description: "Discussion about this forum, its organization, how it works, and how we can improve it." - staff_category_name: "staff" + staff_category_name: "Staff" staff_category_description: "Private category for staff discussions. Topics are only visible to admins and moderators." assets_topic_body: "This is a permanent topic, visible only to staff, for storing images and files used in the forum design. Don't delete it!\n\n\nHere's how:\n\n\n1. Reply to this topic.\n2. Upload all the images you wish to use for logos, favicons, and so forth here. (Use the upload toolbar icon in the post editor, or drag-and-drop or paste images.)\n3. Submit your reply to post it.\n4. Right click the images in your new post to get the path to the uploaded images, or click the edit icon to edit your post and retrieve the path to the images. Copy the image paths.\n5. Paste those image paths into [basic settings](/admin/site_settings/category/required).\n\n\nAlso, if you need to enable different file type uploads, edit `authorized_extensions` in the [file settings](/admin/site_settings/category/files)." diff --git a/db/fixtures/001_categories.rb b/db/fixtures/001_categories.rb index 19b5bc14897..5559eaaa2ef 100644 --- a/db/fixtures/001_categories.rb +++ b/db/fixtures/001_categories.rb @@ -5,8 +5,8 @@ SiteSetting.refresh! if SiteSetting.uncategorized_category_id == -1 || !Category.exists?(SiteSetting.uncategorized_category_id) puts "Seeding uncategorized category!" - result = Category.exec_sql "SELECT 1 FROM categories WHERE name = 'uncategorized'" - name = 'uncategorized' + result = Category.exec_sql "SELECT 1 FROM categories WHERE lower(name) = 'uncategorized'" + name = 'Uncategorized' if result.count > 0 name << SecureRandom.hex end diff --git a/db/migrate/20131022045114_add_uncategorized_category.rb b/db/migrate/20131022045114_add_uncategorized_category.rb index 126f9b7ed0e..953960fd661 100644 --- a/db/migrate/20131022045114_add_uncategorized_category.rb +++ b/db/migrate/20131022045114_add_uncategorized_category.rb @@ -1,8 +1,8 @@ class AddUncategorizedCategory < ActiveRecord::Migration def up - result = execute "SELECT 1 FROM categories WHERE name = 'uncategorized'" - name = 'uncategorized' + result = execute "SELECT 1 FROM categories WHERE lower(name) = 'uncategorized'" + name = 'Uncategorized' if result.count > 0 name << SecureRandom.hex end