mirror of
https://github.com/Neetpone/foalfetch.git
synced 2025-03-11 14:10:07 +01:00
docs: annotate
This commit is contained in:
parent
533eefa935
commit
38d3a0ff14
13 changed files with 211 additions and 5 deletions
|
@ -1,3 +1,15 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: authors
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# avatar :text
|
||||
# bio_html :text
|
||||
# date_joined :datetime not null
|
||||
# name :text not null
|
||||
# num_blog_posts :integer default(0), not null
|
||||
# num_followers :integer default(0), not null
|
||||
#
|
||||
class Author < ApplicationRecord
|
||||
has_many :stories
|
||||
end
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: chapters
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# body :text
|
||||
# date_modified :datetime
|
||||
# date_published :datetime not null
|
||||
# num_views :integer default(0), not null
|
||||
# num_words :integer
|
||||
# number :integer default(1), not null
|
||||
# title :text not null
|
||||
# story_id :bigint not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_chapters_on_story_id (story_id)
|
||||
#
|
||||
class Chapter < ApplicationRecord
|
||||
belongs_to :story
|
||||
end
|
||||
|
|
|
@ -1,3 +1,30 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: stories
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# color :integer
|
||||
# completion_status :text
|
||||
# content_rating :text
|
||||
# cover_image :text
|
||||
# date_modified :datetime
|
||||
# date_published :datetime not null
|
||||
# date_updated :datetime
|
||||
# description_html :text
|
||||
# num_comments :integer default(0), not null
|
||||
# num_views :integer default(0), not null
|
||||
# num_words :integer not null
|
||||
# prequel :integer
|
||||
# rating :integer not null
|
||||
# short_description :text
|
||||
# title :text not null
|
||||
# total_num_views :integer default(0), not null
|
||||
# author_id :bigint not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_stories_on_author_id (author_id)
|
||||
#
|
||||
class Story < ApplicationRecord
|
||||
include FancySearchable::Searchable
|
||||
include Indexable
|
||||
|
|
|
@ -1,6 +1,18 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: story_taggings
|
||||
#
|
||||
# story_id :bigint not null
|
||||
# tag_id :bigint not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_story_taggings_on_story_id (story_id)
|
||||
# index_story_taggings_on_tag_id (tag_id)
|
||||
#
|
||||
class Story::Tagging < ApplicationRecord
|
||||
belongs_to :story
|
||||
belongs_to :tag
|
||||
|
||||
validates :tag, uniqueness: { scope: [:story_id] }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: tags
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# name :text not null
|
||||
# type :text not null
|
||||
# old_id :text
|
||||
#
|
||||
class Tag < ApplicationRecord
|
||||
# needed because we have a column called 'type'
|
||||
self.inheritance_column = '_inheritance_column'
|
||||
|
|
13
test/fixtures/authors.yml
vendored
13
test/fixtures/authors.yml
vendored
|
@ -1,4 +1,15 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: authors
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# avatar :text
|
||||
# bio_html :text
|
||||
# date_joined :datetime not null
|
||||
# name :text not null
|
||||
# num_blog_posts :integer default(0), not null
|
||||
# num_followers :integer default(0), not null
|
||||
#
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the "{}" from the fixture names and add the columns immediately
|
||||
|
|
19
test/fixtures/chapters.yml
vendored
19
test/fixtures/chapters.yml
vendored
|
@ -1,4 +1,21 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: chapters
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# body :text
|
||||
# date_modified :datetime
|
||||
# date_published :datetime not null
|
||||
# num_views :integer default(0), not null
|
||||
# num_words :integer
|
||||
# number :integer default(1), not null
|
||||
# title :text not null
|
||||
# story_id :bigint not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_chapters_on_story_id (story_id)
|
||||
#
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the "{}" from the fixture names and add the columns immediately
|
||||
|
|
28
test/fixtures/stories.yml
vendored
28
test/fixtures/stories.yml
vendored
|
@ -1,4 +1,30 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: stories
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# color :integer
|
||||
# completion_status :text
|
||||
# content_rating :text
|
||||
# cover_image :text
|
||||
# date_modified :datetime
|
||||
# date_published :datetime not null
|
||||
# date_updated :datetime
|
||||
# description_html :text
|
||||
# num_comments :integer default(0), not null
|
||||
# num_views :integer default(0), not null
|
||||
# num_words :integer not null
|
||||
# prequel :integer
|
||||
# rating :integer not null
|
||||
# short_description :text
|
||||
# title :text not null
|
||||
# total_num_views :integer default(0), not null
|
||||
# author_id :bigint not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_stories_on_author_id (author_id)
|
||||
#
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the "{}" from the fixture names and add the columns immediately
|
||||
|
|
10
test/fixtures/tags.yml
vendored
10
test/fixtures/tags.yml
vendored
|
@ -1,4 +1,12 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: tags
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# name :text not null
|
||||
# type :text not null
|
||||
# old_id :text
|
||||
#
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the "{}" from the fixture names and add the columns immediately
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: authors
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# avatar :text
|
||||
# bio_html :text
|
||||
# date_joined :datetime not null
|
||||
# name :text not null
|
||||
# num_blog_posts :integer default(0), not null
|
||||
# num_followers :integer default(0), not null
|
||||
#
|
||||
require "test_helper"
|
||||
|
||||
class AuthorTest < ActiveSupport::TestCase
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: chapters
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# body :text
|
||||
# date_modified :datetime
|
||||
# date_published :datetime not null
|
||||
# num_views :integer default(0), not null
|
||||
# num_words :integer
|
||||
# number :integer default(1), not null
|
||||
# title :text not null
|
||||
# story_id :bigint not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_chapters_on_story_id (story_id)
|
||||
#
|
||||
require "test_helper"
|
||||
|
||||
class ChapterTest < ActiveSupport::TestCase
|
||||
|
|
|
@ -1,3 +1,30 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: stories
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# color :integer
|
||||
# completion_status :text
|
||||
# content_rating :text
|
||||
# cover_image :text
|
||||
# date_modified :datetime
|
||||
# date_published :datetime not null
|
||||
# date_updated :datetime
|
||||
# description_html :text
|
||||
# num_comments :integer default(0), not null
|
||||
# num_views :integer default(0), not null
|
||||
# num_words :integer not null
|
||||
# prequel :integer
|
||||
# rating :integer not null
|
||||
# short_description :text
|
||||
# title :text not null
|
||||
# total_num_views :integer default(0), not null
|
||||
# author_id :bigint not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_stories_on_author_id (author_id)
|
||||
#
|
||||
require "test_helper"
|
||||
|
||||
class StoryTest < ActiveSupport::TestCase
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: tags
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# name :text not null
|
||||
# type :text not null
|
||||
# old_id :text
|
||||
#
|
||||
require "test_helper"
|
||||
|
||||
class TagTest < ActiveSupport::TestCase
|
||||
|
|
Loading…
Add table
Reference in a new issue