X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/bbd769304cf29bbd9574fd3c7167feb7d5d0aa17..cd4fb9d44cdb46704fee9fc0a95f41978f401b2c:/app/models/way_tag.rb?ds=sidebyside diff --git a/app/models/way_tag.rb b/app/models/way_tag.rb index 4548674d4..fa9b43361 100644 --- a/app/models/way_tag.rb +++ b/app/models/way_tag.rb @@ -6,4 +6,9 @@ class WayTag < ActiveRecord::Base # FIXME add a real multipart key to waytags so that we can do eager loadin belongs_to :way, :foreign_key => 'id' + + validates_presence_of :id + validates_length_of :k, :v, :maximum => 255, :allow_blank => true + validates_uniqueness_of :id, :scope => :k + validates_numericality_of :id, :only_integer => true end