Use character validate to exclude URL characters for trace tags

This commit is contained in:
Tom Hughes 2018-11-05 19:07:26 +00:00
parent 56f7e692cd
commit b7438167c0

View file

@ -22,5 +22,5 @@ class Tracetag < ActiveRecord::Base
belongs_to :trace, :foreign_key => "gpx_id"
validates :trace, :associated => true
validates :tag, :length => 1..255, :format => %r{\A[^/;.,?]*\z}, :characters => true
validates :tag, :length => 1..255, :characters => { :url_safe => true }
end