1 # frozen_string_literal: true
 
   3 # == Schema Information
 
   7 #  way_id  :bigint           not null, primary key
 
   8 #  k       :string           not null, primary key
 
  10 #  version :bigint           not null, primary key
 
  14 #  way_tags_id_fkey  ([way_id, version] => ways[way_id, version])
 
  17 class OldWayTag < ApplicationRecord
 
  18   self.table_name = "way_tags"
 
  20   belongs_to :old_way, :foreign_key => [:way_id, :version], :inverse_of => :old_tags
 
  22   validates :old_way, :associated => true
 
  23   validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
 
  24   validates :k, :uniqueness => { :scope => [:way_id, :version] }