File: test_models.rb

package info (click to toggle)
ruby-with-advisory-lock 5.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 244 kB
  • sloc: ruby: 818; makefile: 14
file content (30 lines) | stat: -rw-r--r-- 594 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true

ActiveRecord::Schema.define(version: 1) do
  create_table 'tags', force: true do |t|
    t.string 'name'
  end
  create_table 'tag_audits', id: false, force: true do |t|
    t.string 'tag_name'
  end
  create_table 'labels', id: false, force: true do |t|
    t.string 'name'
  end
end

class ApplicationRecord < ActiveRecord::Base
  self.abstract_class = true
end

class Tag < ApplicationRecord
  after_save do
    TagAudit.create(tag_name: name)
    Label.create(name: name)
  end
end

class TagAudit < ApplicationRecord
end

class Label < ApplicationRecord
end