Skip to content

素敵なインテリアの写真を集めた投稿サイト

Notifications You must be signed in to change notification settings

shukan0728/Roomclip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

test

This README would normally document whatever steps are necessary to get the application up and running.

Things you may want to cover:

  • Ruby version

  • System dependencies

  • Configuration

  • Database creation

  • Database initialization

  • How to run the test suite

  • Services (job queues, cache servers, search engines, etc.)

  • Deployment instructions

  • ...

usersテーブル

Column Type Options
name string null: false
password varchar null: false
e-mail varchar
image text

Association

  • has_many :clips
  • has_many :likes
  • has_many :comments
  • has_many :folder_clips, dependent: :destroy
  • has_many :folders
  • has_many :tag_clips
  • has_one :profile
  • has_one :count
  • has_many :active_relationships, class_name: "Relationship", dependent: :destroy
  • has_many :passive_relationships, class_name: "Relationship", dependent: :destroy
  • has_many :follows, through: :active_relationship
  • has_many :followers, through: :passive_relationships
  • validates :name, length: {minimun: 3 maximum: 10}, presence: true
  • validates :email, uniqueness: true
  • validates :password, length {minimum: 3 maximum: 10}, confirmation: true, presenve: true

clipsテーブル

Column Type Options
user_id references null: false, foreign_key: true
image text null: false
likes_count integer

Association

  • belongs_to :user, counter_cache: :clips_count
  • has_many :comments, dependent: :destroy
  • has_many :likes, dependent: :destroy
  • has_many :folder_clips, dependent: :destroy
  • has_many :folders, through: :folder_clip
  • has_many :tag_clips, dependent: :destroy
  • has_many :main_tag, thorugh: :tag_clip
  • has_many :sub_tag, thorugh: :tag_clip
  • has_many :itemtag_clips, dependent: :destroy
  • has_many :item_tag, thorugh: :itemtag_clip
  • validates :image, presence: true

commentsテーブル

Column Type Options
user_id references null: false, foreign_key: true
clip references null: false, foreign_key: true
text text

Association

  • belongs_to :user
  • has_many :clips

likesテーブル

Column Type Options
user_id references null: false, foreign_key: true
clip references null: false, foreign_key: true

Association

  • belongs_to :user, counter_cache: :likes_count
  • belongs_to :clips, counter_cache: :likes_count

foldersテーブル

Column Type Options
user_id references null: false, foreign_key: true
name string null: false

Association

  • belongs_to :user, counter_cache: :folders_count
  • has_many :clips, through: :folder_clip
  • has_many :folder_clips

folder_clipsテーブル

Column Type Options
folder references null: false, foreign_key: true
clip references null: false, foreign_key: true

Association

  • belongs_to :folder
  • belongs_to :clip

tag_clipsテーブル

Column Type Options
clip references null: false, foreign_key: true
user references null: false, foreign_key: true, unique: true
main_tag references null: false, foreign_key: true
sub_tag references null: false, foreign_key: true

Association

  • belongs_to :clip _ belongs_to :user, counter_cache: :tags_count
  • belongs_to :main_tag
  • belongs_to :sub_tag

main_tagsテーブル

Column Type Options
name string null: false, unique: true, index: true

Association

  • has_many :tag_clips, dependent: :destroy
  • has_many :clips, through: :tag_clip

sub_tagsテーブル

Column Type Options
name string null: false, unique: true, index: true

Association

  • has_many :tag_clips, dependent: :destroy
  • has_many :clips, through: :tag_clip

itemtag_clipsテーブル

Column Type Options
clip references null: false, foreign_key: true
item_tag references null: false, foreign_key: true

Association

  • belongs_to :clip
  • belongs_to :item_tag

item_tagsテーブル

Column Type Options
name string null: false, unique: true, index: true

Association

  • has_many :itemtag_clips, dependent: :destroy
  • has_many :clips, thorugh: :itemtag_clip

profilesテーブル

Column Type Options
user_id references null: false, foreign_key: true, unique: true
country references foreign_key: true
religion references foreign_key: true
style references foreign_key: true
job references foreign_key: true
gender references foreign_key: true
year references foreign_key: true
layout references foreign_key: true
area string
website varchar
introduction text

Association

  • belongs_to :user

countsテーブル

Column Type Options
user_id references null: false, foreign_key: true
clips_count integer
follows_count integer
followers_count integer
likes_count integer
tags_count integer
folders_count integer

Association

  • belongs_to :user

relationshipsテーブル

Column Type Options
active_relationships
follower_id references null: false, foreign_key: true
passive_relationships
follow_id references null: false, foreign_key: true

Association

  • belongs_to :follow, class_name: 'User'
  • belongs_to :follower, class_name: 'User'
  • validates :follower_id, presence: true
  • validates :follow_id, presence: true

About

素敵なインテリアの写真を集めた投稿サイト

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 53.0%
  • CSS 25.2%
  • Ruby 20.5%
  • JavaScript 1.3%