]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/trace.rb
New seg id is now returned complete
[rails.git] / app / models / trace.rb
index 014db4ae2640057ff146bf943f4a32ebcf83a04c..7c4b5de18d4580de1de4ecbe6903762e5cc33f34 100644 (file)
@@ -2,10 +2,13 @@ class Trace < ActiveRecord::Base
   set_table_name 'gpx_files'
 
   belongs_to :user
+  has_many :tags, :class_name => 'Tracetag', :foreign_key => 'gpx_id', :dependent => :destroy
 
-  def tags=(bleh)
-  end
-
-  def mime_type=(bleh)
+  def tagstring=(s)
+    self.tags = s.split().collect {|tag|
+      tt = Tracetag.new
+      tt.tag = tag
+      tt
+    }
   end
 end