about summary refs log tree commit diff
path: root/app/models/tag.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-12-17 13:31:56 +0100
committerEugen Rochko <eugen@zeonfederated.com>2019-12-17 13:31:56 +0100
commitda2143b3089ec16fca449b97acbfb65acfe92197 (patch)
treeefce61c5a3092442d477bc555fe1f63becbc52d6 /app/models/tag.rb
parent3830c0b74168070cdd410d311ba85a3b323bca9f (diff)
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 dff46b260b2f7d765d254c84a4b89105c7de5e97.

* Fix statuses being rejected because of invalid hashtag names

* Add spec for invalid hashtag names in statuses

* Add test for featured tags controller
Diffstat (limited to 'app/models/tag.rb')
-rw-r--r--app/models/tag.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/tag.rb b/app/models/tag.rb
index d3a7e1e6d..bce76fc16 100644
--- a/app/models/tag.rb
+++ b/app/models/tag.rb
@@ -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?