0
0
Fork 0

Fixes featured hashtag setting page erroring out instead of rejecting invalid tags (#12436)

* Revert "Fix ignoring whole status because of one invalid hashtag (#11621)"

This reverts commit dff46b260b.

* Fix statuses being rejected because of invalid hashtag names

* Add spec for invalid hashtag names in statuses

* Add test for featured tags controller
This commit is contained in:
ThibG 2019-12-17 13:31:56 +01:00 committed by Eugen Rochko
parent 3830c0b741
commit da2143b308
4 changed files with 67 additions and 2 deletions

View file

@ -117,7 +117,7 @@ class Tag < ApplicationRecord
class << self
def find_or_create_by_names(name_or_names)
Array(name_or_names).map(&method(:normalize)).uniq { |str| str.mb_chars.downcase.to_s }.map do |normalized_name|
tag = matching_name(normalized_name).first || create!(name: normalized_name)
tag = matching_name(normalized_name).first || create(name: normalized_name)
yield tag if block_given?