Strip leading/trailing whitespace from comma-separated trace tags
This commit is contained in:
parent
48fff2bfea
commit
b54c03389b
2 changed files with 17 additions and 2 deletions
|
@ -57,7 +57,7 @@ class Trace < ApplicationRecord
|
|||
|
||||
def tagstring=(s)
|
||||
self.tags = if s.include? ","
|
||||
s.split(/\s*,\s*/).grep_v(/^\s*$/).collect do |tag|
|
||||
s.split(",").map(&:strip).reject(&:empty?).collect do |tag|
|
||||
tt = Tracetag.new
|
||||
tt.tag = tag
|
||||
tt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue