]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_way_tag.rb
Combine the address and netmask for an ACL in one column
[rails.git] / app / models / old_way_tag.rb
index 801532dbaa7632d2074e33fbb48ac4a5251285a3..9f4adb147fd6572e83f7c00b6e140c0fc14d3eda 100644 (file)
@@ -1,10 +1,11 @@
 class OldWayTag < ActiveRecord::Base
   set_table_name 'way_tags'
+  set_primary_keys :way_id, :version, :k
 
-  belongs_to :old_way, :foreign_key => [:id, :version]
+  belongs_to :old_way, :foreign_key => [:way_id, :version]
 
-  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
+  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