File tree Expand file tree Collapse file tree 5 files changed +84
-0
lines changed
Expand file tree Collapse file tree 5 files changed +84
-0
lines changed Original file line number Diff line number Diff line change 1+ # == Schema Information
2+ #
3+ # Table name: tags
4+ #
5+ # id :bigint not null, primary key
6+ # name :string
7+ # taggings_count :integer default(0)
8+ # created_at :datetime not null
9+ # updated_at :datetime not null
10+ #
11+ # Indexes
12+ #
13+ # index_tags_on_name (name) UNIQUE
14+ #
115class Tag < ActsAsTaggableOn ::Tag
216 has_many :tag_cognates , dependent : :destroy
317 has_many :cognates , through : :tag_cognates
Original file line number Diff line number Diff line change 1+ # == Schema Information
2+ #
3+ # Table name: tag_cognates
4+ #
5+ # id :bigint not null, primary key
6+ # created_at :datetime not null
7+ # updated_at :datetime not null
8+ # cognate_id :bigint
9+ # tag_id :bigint
10+ #
11+ # Indexes
12+ #
13+ # index_tag_cognates_on_cognate_id (cognate_id)
14+ # index_tag_cognates_on_tag_id (tag_id)
15+ # index_tag_cognates_on_tag_id_and_cognate_id (tag_id,cognate_id) UNIQUE
16+ #
17+ # Foreign Keys
18+ #
19+ # fk_rails_... (cognate_id => tags.id)
20+ # fk_rails_... (tag_id => tags.id)
21+ #
122FactoryBot . define do
223 factory :tag_cognate do
324 association :tag
Original file line number Diff line number Diff line change 1+ # == Schema Information
2+ #
3+ # Table name: tags
4+ #
5+ # id :bigint not null, primary key
6+ # name :string
7+ # taggings_count :integer default(0)
8+ # created_at :datetime not null
9+ # updated_at :datetime not null
10+ #
11+ # Indexes
12+ #
13+ # index_tags_on_name (name) UNIQUE
14+ #
115FactoryBot . define do
216 factory :tag do
317 name { Faker ::ProgrammingLanguage . name }
Original file line number Diff line number Diff line change 1+ # == Schema Information
2+ #
3+ # Table name: tag_cognates
4+ #
5+ # id :bigint not null, primary key
6+ # created_at :datetime not null
7+ # updated_at :datetime not null
8+ # cognate_id :bigint
9+ # tag_id :bigint
10+ #
11+ # Indexes
12+ #
13+ # index_tag_cognates_on_cognate_id (cognate_id)
14+ # index_tag_cognates_on_tag_id (tag_id)
15+ # index_tag_cognates_on_tag_id_and_cognate_id (tag_id,cognate_id) UNIQUE
16+ #
17+ # Foreign Keys
18+ #
19+ # fk_rails_... (cognate_id => tags.id)
20+ # fk_rails_... (tag_id => tags.id)
21+ #
122require "rails_helper"
223
324RSpec . describe TagCognate , type : :model do
Original file line number Diff line number Diff line change 1+ # == Schema Information
2+ #
3+ # Table name: tags
4+ #
5+ # id :bigint not null, primary key
6+ # name :string
7+ # taggings_count :integer default(0)
8+ # created_at :datetime not null
9+ # updated_at :datetime not null
10+ #
11+ # Indexes
12+ #
13+ # index_tags_on_name (name) UNIQUE
14+ #
115require "rails_helper"
216
317RSpec . describe Tag , type : :model do
You can’t perform that action at this time.
0 commit comments