Fix the tag matches option

The split function was mistakenly used instead of the match function.
This commit is contained in:
BrokenEagle
2020-06-23 05:46:25 +00:00
parent fd6ba473a5
commit 1a87935764
2 changed files with 8 additions and 1 deletions

View File

@@ -33,7 +33,7 @@ class PostVersion < ApplicationRecord
end
def tag_matches(string)
tag = string.split(/\S+/)[0]
tag = string.match(/\S+/)[0]
return all if tag.nil?
tag = "*#{tag}*" unless tag =~ /\*/
where_ilike(:tags, tag)