1 class Trace < ActiveRecord::Base
 
   2   set_table_name 'gpx_files'
 
   5   has_many :tags, :class_name => 'Tracetag', :foreign_key => 'gpx_id', :dependent => :destroy
 
   8     self.tags = s.split().collect {|tag|
 
  15   def large_picture= (data)
\r 
  16     f = File.new(large_picture_name, "wb")
\r 
  21   def icon_picture= (data)
\r 
  22     f = File.new(icon_picture_name, "wb")
\r 
  28     f = File.new(large_picture_name, "rb")
\r 
  29     logger.info "large picture file: '#{f.path}', bytes: #{File.size(f.path)}"
\r 
  30     data = f.sysread(File.size(f.path))
\r 
  31     logger.info "have read data, bytes: '#{data.length}'"
\r 
  37     f = File.new(icon_picture_name, "rb")
\r 
  38     logger.info "icon picture file: '#{f.path}'"
\r 
  39     data = f.sysread(File.size(f.path))
\r 
  44   # FIXME change to permanent filestore area
\r 
  45   def large_picture_name
\r 
  49   # FIXME change to permanent filestore area
\r 
  50   def icon_picture_name
\r 
  51     "/tmp/#{id}_icon.gif"
\r