X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ece8999dcdfa84f146aa7ad39071b48260b0d7fe..e7c2d2a211e0f5604acc53f4a941067d94d675a9:/app/models/trace.rb?ds=sidebyside diff --git a/app/models/trace.rb b/app/models/trace.rb index 014db4ae2..7c4b5de18 100644 --- a/app/models/trace.rb +++ b/app/models/trace.rb @@ -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