X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/8dbaf76e7cbdaa3aa0c6a9ac8d1fb886c1fe9fcd..417ded9da545299026b96f5f81f79897f8e3769b:/app/models/trace.rb diff --git a/app/models/trace.rb b/app/models/trace.rb index a0ec22dee..1b44e2187 100644 --- a/app/models/trace.rb +++ b/app/models/trace.rb @@ -3,6 +3,8 @@ class Trace < ActiveRecord::Base validates_presence_of :user_id, :name, :timestamp validates_presence_of :description, :on => :create + validates_length_of :name, :within => 1..255 + validates_length_of :description, :within => 1..255 # validates_numericality_of :latitude, :longitude validates_inclusion_of :public, :inserted, :in => [ true, false] @@ -58,18 +60,16 @@ class Trace < ActiveRecord::Base data end - # FIXME change to permanent filestore area def large_picture_name - "/home/osm/icons/#{id}.gif" + "#{GPX_IMAGE_DIR}/#{id}.gif" end - # FIXME change to permanent filestore area def icon_picture_name - "/home/osm/icons/#{id}_icon.gif" + "#{GPX_IMAGE_DIR}/#{id}_icon.gif" end def trace_name - "/home/osm/gpx/#{id}.gpx" + "#{GPX_TRACE_DIR}/#{id}.gpx" end def mime_type