X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/bed9cd00ed166ce346da4b8a9b654ddf86e64e70..5a98d6e4f190d1b141695b8dd3bfb9d17bfcadee:/app/models/old_node_tag.rb diff --git a/app/models/old_node_tag.rb b/app/models/old_node_tag.rb index 3fd4bf86b..cd5bc4739 100644 --- a/app/models/old_node_tag.rb +++ b/app/models/old_node_tag.rb @@ -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