-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
5010 – Fix tag with trailing space error (#1982)
When trying to create an imported fact-check that had a tag with a trailing space it would fail (`text has already been taken`). We have a normalization step but that runs `before_validation` on `TagText`. So when we are checking if the tag exists in line 92 from `tag.rb`, the tag has not been normalized. This means: - We look for 'tag', it is not there. We create it. - We look for ' tag', it is not there. We try to create it, it gets normalized, so it becomes 'tag'. Then we fail to create it, because it already exists. Adding the strip when comparing tags fixes this. Tests - rails test test/controllers/graphql_controller_12_test.rb:613 - rails test test/models/tag_test.rb:275 References: 5010 PR: 1982
- Loading branch information
1 parent
72bf8bf
commit 7fabdb7
Showing
3 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters