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