]> git.openstreetmap.org Git - rails.git/commitdiff
Ignore empty tags. Closes #2311.
authorTom Hughes <tom@compton.nu>
Thu, 24 Sep 2009 23:27:13 +0000 (23:27 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 24 Sep 2009 23:27:13 +0000 (23:27 +0000)
app/models/trace.rb

index cbfd68996ff5a7944ecb5df197a01163fd670575..24f93236a7367200d6c50f8aa4eccbfdce9a32ec 100644 (file)
@@ -26,7 +26,7 @@ class Trace < ActiveRecord::Base
 
   def tagstring=(s)
     if s.include? ','
-      self.tags = s.split(/\s*,\s*/).collect {|tag|
+      self.tags = s.split(/\s*,\s*/).select {|tag| tag !~ /^\s*$/}.collect {|tag|
         tt = Tracetag.new
         tt.tag = tag
         tt