Skip to content

Commit c8d7925

Browse files
committed
feat(tags): update annotations
1 parent 632f36b commit c8d7925

File tree

5 files changed

+84
-0
lines changed

5 files changed

+84
-0
lines changed

app/models/tag.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
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+
#
115
class Tag < ActsAsTaggableOn::Tag
216
has_many :tag_cognates, dependent: :destroy
317
has_many :cognates, through: :tag_cognates

spec/factories/tag_cognates.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
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+
#
122
FactoryBot.define do
223
factory :tag_cognate do
324
association :tag

spec/factories/tags.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
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+
#
115
FactoryBot.define do
216
factory :tag do
317
name { Faker::ProgrammingLanguage.name }

spec/models/tag_cognate_spec.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
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+
#
122
require "rails_helper"
223

324
RSpec.describe TagCognate, type: :model do

spec/models/tag_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
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+
#
115
require "rails_helper"
216

317
RSpec.describe Tag, type: :model do

0 commit comments

Comments
 (0)