X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/bbd769304cf29bbd9574fd3c7167feb7d5d0aa17..03eb6ce048047826cb40d73e755702ec51b916d5:/app/models/way_tag.rb 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