]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/tracetag.rb
Move tag validation to the right place.
[rails.git] / app / models / tracetag.rb
index d74a1e75a822a001196132dd993c1834e40778d9..f1d5967d53dd5c38b75d591b792cf6a330cd69ad 100644 (file)
@@ -1,6 +1,7 @@
 class Tracetag < ActiveRecord::Base
   set_table_name 'gpx_file_tags'
 
-  belongs_to :trace, :foreign_key => 'gpx_id'
+  validates_format_of :tag, :with => /^[^\/;.,?]*$/
 
+  belongs_to :trace, :foreign_key => 'gpx_id'
 end