]> git.openstreetmap.org Git - rails.git/commitdiff
Move tag validation to the right place.
authorTom Hughes <tom@compton.nu>
Sun, 19 Aug 2007 09:16:33 +0000 (09:16 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 19 Aug 2007 09:16:33 +0000 (09:16 +0000)
app/models/trace.rb
app/models/tracetag.rb

index 7d4f01dad344b8ad503d5920b4374faa793b3f4b..c189c035ec8fb3e4812c52d2d07d659c9a615b92 100644 (file)
@@ -3,7 +3,6 @@ class Trace < ActiveRecord::Base
 
   validates_presence_of :user_id, :name, :timestamp
   validates_presence_of :description, :on => :create
 
   validates_presence_of :user_id, :name, :timestamp
   validates_presence_of :description, :on => :create
-  validates_format_of :tagstring, :with => /^[^\/;.,?]*$/
 #  validates_numericality_of :latitude, :longitude
   validates_inclusion_of :public, :inserted, :in => [ true, false]
   
 #  validates_numericality_of :latitude, :longitude
   validates_inclusion_of :public, :inserted, :in => [ true, false]
   
index d74a1e75a822a001196132dd993c1834e40778d9..f1d5967d53dd5c38b75d591b792cf6a330cd69ad 100644 (file)
@@ -1,6 +1,7 @@
 class Tracetag < ActiveRecord::Base
   set_table_name 'gpx_file_tags'
 
 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
 end