]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_way_tag.rb
Relation Tag testing. Also sort the belong_to/has_many for user/changeset/old_way.
[rails.git] / app / models / old_way_tag.rb
index 7fe61968fd13de1e4d6d4d0ae5fe639512f4b64d..68003cbebad7151084f4cd9f8369d8b43094f7cd 100644 (file)
@@ -1,2 +1,10 @@
 class OldWayTag < ActiveRecord::Base
+  belongs_to :old_way
+
+  set_table_name 'way_tags'
+
+  validates_presence_of :id
+  validates_length_of :k, :v, :maximum => 255, :allow_blank => true
+  validates_uniqueness_of :id, :scope => [:k, :version]
+  validates_numericality_of :id, :version, :only_integer => true
 end