Commit 45de7d263d8494d0aaaf99d7a6c44f7f9d2adf09

Authored by Drew Blessing
1 parent 45efba58

Issue-4769 - Unable to update case of label

Labels are saved in the database with the case they were originally created with.
Before this change if a user created a label with the same text but different case
the label would use the original case and no new label would be created in the
database. With this change, labels are now case-sensitive.

Steps to test:

1. Before this change, create a new issue with a new label "FIxMe"
2. Edit the issue and change the label to "FixMe"
3. Note that the label reverted to "FIxMe"
4. Apply this change
5. Edit the issue again and change the label to "FixMe"
Note that the new case was preserved. If you also look in the database in the "tags" table you will see that both labels are present - "FIxMe" and "FixMe".
Showing 2 changed files with 4 additions and 0 deletions   Show diff stats
app/models/issue.rb
... ... @@ -21,6 +21,8 @@ class Issue < ActiveRecord::Base
21 21 include Issuable
22 22 include InternalId
23 23  
  24 + ActsAsTaggableOn.strict_case_match = true
  25 +
24 26 belongs_to :project
25 27 validates :project, presence: true
26 28  
... ...
app/models/project.rb
... ... @@ -27,6 +27,8 @@
27 27 class Project < ActiveRecord::Base
28 28 include Gitlab::ShellAdapter
29 29 extend Enumerize
  30 +
  31 + ActsAsTaggableOn.strict_case_match = true
30 32  
31 33 attr_accessible :name, :path, :description, :default_branch, :issues_tracker, :label_list,
32 34 :issues_enabled, :wall_enabled, :merge_requests_enabled, :snippets_enabled, :issues_tracker_id,
... ...