]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/way_tag.rb
Adding a README to the translations folder, so that people hopefully don't edit in...
[rails.git] / app / models / way_tag.rb
index 4548674d4b950607e2396ecc079da2e3951bba4c..fa9b4336177061287d00d4b153a9da6cef28c6a9 100644 (file)
@@ -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