]> git.openstreetmap.org Git - rails.git/blob - app/models/changeset_tag.rb
cf8af6ba929a298dbdd42d061778d3e44c947289
[rails.git] / app / models / changeset_tag.rb
1 # == Schema Information
2 #
3 # Table name: changeset_tags
4 #
5 #  changeset_id :bigint(8)        not null, primary key
6 #  k            :string           default(""), not null, primary key
7 #  v            :string           default(""), not null
8 #
9 # Foreign Keys
10 #
11 #  changeset_tags_id_fkey  (changeset_id => changesets.id)
12 #
13
14 class ChangesetTag < ApplicationRecord
15   self.primary_keys = "changeset_id", "k"
16
17   belongs_to :changeset
18
19   validates :changeset, :associated => true
20   validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
21   validates :k, :uniqueness => { :scope => :changeset_id }
22 end