Move tag validation to the right place.
This commit is contained in:
parent
7dbb746fde
commit
9861ca8001
2 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,6 @@ class Trace < ActiveRecord::Base
|
||||||
|
|
||||||
validates_presence_of :user_id, :name, :timestamp
|
validates_presence_of :user_id, :name, :timestamp
|
||||||
validates_presence_of :description, :on => :create
|
validates_presence_of :description, :on => :create
|
||||||
validates_format_of :tagstring, :with => /^[^\/;.,?]*$/
|
|
||||||
# validates_numericality_of :latitude, :longitude
|
# validates_numericality_of :latitude, :longitude
|
||||||
validates_inclusion_of :public, :inserted, :in => [ true, false]
|
validates_inclusion_of :public, :inserted, :in => [ true, false]
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
class Tracetag < ActiveRecord::Base
|
class Tracetag < ActiveRecord::Base
|
||||||
set_table_name 'gpx_file_tags'
|
set_table_name 'gpx_file_tags'
|
||||||
|
|
||||||
belongs_to :trace, :foreign_key => 'gpx_id'
|
validates_format_of :tag, :with => /^[^\/;.,?]*$/
|
||||||
|
|
||||||
|
belongs_to :trace, :foreign_key => 'gpx_id'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue