]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_node_tag.rb
Spell way_id correctly
[rails.git] / app / models / old_node_tag.rb
index 3fd4bf86b4fb71504e5c92f58fa6da570f8f0c07..cd5bc4739195d59f7aa8f8825609f6f52e949c8d 100644 (file)
@@ -1,10 +1,11 @@
 class OldNodeTag < ActiveRecord::Base
   set_table_name 'node_tags'
-  
-  belongs_to :user
+  set_primary_keys :node_id, :version, :k
 
-  validates_presence_of :id, :version
-  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
+  belongs_to :old_node, :foreign_key => [:node_id, :version]
+
+  validates_presence_of :old_node
+  validates_length_of :k, :maximum => 255, :allow_blank => true
+  validates_uniqueness_of :k, :scope => [:node_id, :version]
+  validates_length_of :v, :maximum => 255, :allow_blank => true
 end