X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/fb1467a94487cfdfcb19e4f88e05be7aa88096f0..dd1f94e3414d1cbea71706dcb0e3a418db208efd:/app/models/trace.rb diff --git a/app/models/trace.rb b/app/models/trace.rb index 0c3caa90c..7c4b5de18 100644 --- a/app/models/trace.rb +++ b/app/models/trace.rb @@ -1,10 +1,14 @@ class Trace < ActiveRecord::Base set_table_name 'gpx_files' - has_many :old_nodes, :foreign_key => :id belongs_to :user + has_many :tags, :class_name => 'Tracetag', :foreign_key => 'gpx_id', :dependent => :destroy - def tags=(bleh) - + def tagstring=(s) + self.tags = s.split().collect {|tag| + tt = Tracetag.new + tt.tag = tag + tt + } end end