]> git.openstreetmap.org Git - rails.git/blob - app/models/old_way_tag.rb
Merge remote-tracking branch 'upstream/pull/1857'
[rails.git] / app / models / old_way_tag.rb
1 # == Schema Information
2 #
3 # Table name: way_tags
4 #
5 #  way_id  :integer          default(0), not null, primary key
6 #  k       :string           not null, primary key
7 #  v       :string           not null
8 #  version :integer          not null, primary key
9 #
10 # Foreign Keys
11 #
12 #  way_tags_id_fkey  (way_id => ways.way_id)
13 #
14
15 class OldWayTag < ActiveRecord::Base
16   self.table_name = "way_tags"
17   self.primary_keys = "way_id", "version", "k"
18
19   belongs_to :old_way, :foreign_key => [:way_id, :version]
20
21   validates :old_way, :presence => true, :associated => true
22   validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }
23   validates :k, :uniqueness => { :scope => [:way_id, :version] }
24 end