X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/c0b9420c7bf86c80a9f073f45f5a865e39902eb8..ebbcf63f0d910458ae255a84de794e3ccede7a7a:/app/models/trace.rb diff --git a/app/models/trace.rb b/app/models/trace.rb index 03dbeb0b3..692c20fc6 100644 --- a/app/models/trace.rb +++ b/app/models/trace.rb @@ -20,15 +20,23 @@ class Trace < ActiveRecord::Base end def tagstring - return tags.collect {|tt| tt.tag}.join(" ") + return tags.collect {|tt| tt.tag}.join(", ") end def tagstring=(s) - self.tags = s.split().collect {|tag| - tt = Tracetag.new - tt.tag = tag - tt - } + if s.include?',' + self.tags = s.split(/\s*,\s*/).collect {|tag| + tt = Tracetag.new + tt.tag = tag + tt + } + else + self.tags = s.split().collect {|tag| + tt = Tracetag.new + tt.tag = tag + tt + } + end end def large_picture= (data)