FEATURE: Mixed case tagging (#6454)

- By default, behaviour is not changed: tags are made lowercase upon creation and edit.

- If force_lowercase_tags is disabled, then mixed case tags are allowed.

- Tags must remain case-insensitively unique. This is enforced by ActiveRecord and Postgres.

- A migration is added to provide a `UNIQUE` index on `lower(name)`. Migration includes a safety to correct any current tags that do not meet the criteria.

- A `where_name` scope is added to `models/tag.rb`, to allow easy case-insensitive lookups. This is used instead of `Tag.where(name: "blah")`.

- URLs remain lowercase. Mixed case URLs are functional, but have the lowercase equivalent as the canonical.
This commit is contained in:
David Taylor
2018-10-05 10:23:52 +01:00
committed by GitHub
parent 8430ea927e
commit 9bf522f227
23 changed files with 137 additions and 43 deletions

View File

@@ -1798,6 +1798,7 @@ en:
min_trust_level_to_tag_topics: "Minimum trust level required to tag topics"
suppress_overlapping_tags_in_list: "If tags match exact words in topic titles, don't show the tag"
remove_muted_tags_from_latest: "Don't show topics tagged with muted tags in the latest topic list."
force_lowercase_tags: "Force all new tags to be entirely lowercase."
company_short_name: "Company Name (short)"
company_full_name: "Company Name (full)"

View File

@@ -1788,3 +1788,5 @@ tags:
client: true
remove_muted_tags_from_latest:
default: false
force_lowercase_tags:
default: true