]> git.openstreetmap.org Git - rails.git/blob - app/models/node_tag.rb
Merge pull request #6394 from openstreetmap/dependabot/github_actions/ruby/setup...
[rails.git] / app / models / node_tag.rb
1 # frozen_string_literal: true
2
3 # == Schema Information
4 #
5 # Table name: current_node_tags
6 #
7 #  node_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_node_tags_id_fkey  (node_id => current_nodes.id)
14 #
15
16 class NodeTag < ApplicationRecord
17   self.table_name = "current_node_tags"
18
19   belongs_to :node
20
21   validates :node, :associated => true
22   validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
23   validates :k, :uniqueness => { :scope => :node_id }
24 end