]> git.openstreetmap.org Git - rails.git/blob - app/models/relation_tag.rb
Add frozen_string_literal comments to ruby files
[rails.git] / app / models / relation_tag.rb
1 # frozen_string_literal: true
2
3 # == Schema Information
4 #
5 # Table name: current_relation_tags
6 #
7 #  relation_id :bigint           not null, primary key
8 #  k           :string           default(""), not null, primary key
9 #  v           :string           default(""), not null
10 #
11 # Foreign Keys
12 #
13 #  current_relation_tags_id_fkey  (relation_id => current_relations.id)
14 #
15
16 class RelationTag < ApplicationRecord
17   self.table_name = "current_relation_tags"
18
19   belongs_to :relation
20
21   validates :relation, :associated => true
22   validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
23   validates :k, :uniqueness => { :scope => :relation_id }
24 end