X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/5449cf4adcc1fad4b9f43426e6d3e4a8f65e6fbb..990f3eba4069f98a11d98f18b18d0e35bcf295f4:/app/models/old_node_tag.rb diff --git a/app/models/old_node_tag.rb b/app/models/old_node_tag.rb index 3fd4bf86b..eef1e02d5 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 + self.table_name = "node_tags" + self.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