]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_way_tag.rb
Spell way_id correctly
[rails.git] / app / models / old_way_tag.rb
index 7fe61968fd13de1e4d6d4d0ae5fe639512f4b64d..9f4adb147fd6572e83f7c00b6e140c0fc14d3eda 100644 (file)
@@ -1,2 +1,11 @@
 class OldWayTag < ActiveRecord::Base
+  set_table_name 'way_tags'
+  set_primary_keys :way_id, :version, :k
+
+  belongs_to :old_way, :foreign_key => [:way_id, :version]
+
+  validates_presence_of :old_way
+  validates_length_of :k, :maximum => 255, :allow_blank => true
+  validates_uniqueness_of :k, :scope => [:way_id, :version]
+  validates_length_of :v, :maximum => 255, :allow_blank => true
 end