]> git.openstreetmap.org Git - rails.git/blob - app/models/tracetag.rb
Merge pull request #6394 from openstreetmap/dependabot/github_actions/ruby/setup...
[rails.git] / app / models / tracetag.rb
1 # frozen_string_literal: true
2
3 # == Schema Information
4 #
5 # Table name: gpx_file_tags
6 #
7 #  gpx_id :bigint           not null
8 #  tag    :string           not null
9 #  id     :bigint           not null, primary key
10 #
11 # Indexes
12 #
13 #  gpx_file_tags_gpxid_idx  (gpx_id)
14 #  gpx_file_tags_tag_idx    (tag)
15 #
16 # Foreign Keys
17 #
18 #  gpx_file_tags_gpx_id_fkey  (gpx_id => gpx_files.id)
19 #
20
21 class Tracetag < ApplicationRecord
22   self.table_name = "gpx_file_tags"
23
24   belongs_to :trace, :foreign_key => "gpx_id", :inverse_of => :tags
25
26   validates :trace, :associated => true
27   validates :tag, :length => 1..255, :characters => { :url_safe => true }
28 end