Skip to content

takareinhard/freemarket_sample_55

Repository files navigation

userモデル

Column Type Options
email string null: false,unique: true, default: ""
encrypted_password string null: false, default: ""
earnings integer default: 0
points integer default: 0
card_token string

Association

  • has_many :administrators_message
  • has_many :notifications
  • has_many :todos
  • has_many :sell_values
  • has_many :buy_values
  • has_many :comment_products
  • has_many :dealings
  • has_many :dealing_chat_messages
  • has_many :likes
  • has_many :products
  • has_many :buyer_dealings, class_name: 'Dealing', foreign_key: 'buyer_id'
  • has_many :seller_dealings, class_name: 'Dealing', foreign_key: 'seller_id'
  • has_many :buyer_sell_values, class_name: 'BuyValue', foreign_key: 'buyer_id'
  • has_many :seller_sell_values, class_name: 'SellValue', foreign_key: 'seller_id'
  • has_many :rates
  • has_one :sms_authentication
  • has_one :credit_card
  • has_one :profile
  • accepts_nested_attributes_for :profile

profileモデル

Column Type Options
nickname string null: false
first_name string null: false,limit: 50
last_name string null: false,limit: 50
first_name_kana string null: false,limit: 50
last_name_kana string null: false,limit: 50
post_number integer
prefecture integer
city string
house_number string
building_name string
birthday date null: false
tel_number integer
profile text
avatar string
user references null: false, foreign_key: true

Association

  • belongs_to :user

sms_authenticationモデル

Column Type Options
phone_number integer null: false
user references null: false, foreign_key: true

Association

  • belongs_to :user

credit_cardモデル

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

Association

  • belongs_to :user

productモデル

Column Type Options
name string null: false, index: true
price integer null: false
detail text null: false
condition integer null: false
postage_payer integer null: false
shipping_area integer null: false
shipping_days integer null: false
deal integer default: 0
category references null: false, forign_key: true
user references null: false, foreign_key: true

Associations

  • has_many :likes
  • has_many :product_images
  • has_one :sell_values
  • has_one :buy_values
  • has_one :product_size
  • has_one :brand
  • has_one :dealing
  • belongs_to :user
  • belongs_to :category

comment_productsモデル

Column Type Options
comment text null: false
product references null: false, foreign_key: true
user references null: false, foreign_key: true

Association

  • has_many :products
  • belongs_to :user

likeモデル

Column Type Options
product references null: false, foreign_key: true
user references null: false, foreign_key: true

Association

  • belongs_to :product
  • belongs_to :user

product_imagesモデル

Column Type Options
image string null: false
product references null: false, foreign_key: true

Association

  • belongs_to :product

administrator_messagesモデル

Column Type Options
title string null: false
message text null: false
type integer default: 0
url string
user references default: 0, foreign_key: true

Association

  • has_one :user

notificationsモデル

Column Type Options
title string null: false
message text null: false
user references default: 0, foreign_key: true

Association

  • belongs_to :user

brandsモデル

Column Type Options
name string null: false, default: ""

Association

  • has_many :products
  • has_many :categories

product_sizeモデル

Column Type Options
size string null: false
product references null: false, foreign_key: true

Association

  • belongs_to :product

categoriesモデル

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

Association

  • has_many :products
  • has_one :category_option 

category_optionsモデル

Column Type Options
brand integer default:0
size integer default:0
category references null: false, foreign_key: true

Association

  • belongs_to :category

dealingsモデル

Column Type Options
phase integer default:0
seller_datetime datetime null: false
buyer_datetime datetime null: false
product references null: false, foreign_key: true
buyer references null: false, foreign_key: true
seller references null: false, foreign_key: true

Association

  • belongs_to :product
  • belongs_to :buyer, class_name: 'User', foreign_key: 'buyer_id'
  • belongs_to :seller, class_name: 'User', foreign_key: 'seller_id'
  • has_many :dealing_chat_messages
  • has_many :todos
  • has_many :rates

dealing_chat_messagesモデル

Column Type Options
messages text null: false
dealing references null: false, foreign_key: true
user references null: false, foreign_key: true

Association

  • belongs_to :dealing
  • belongs_to :user

sell_valuesモデル

Column Type Options
rate integer null: false
comment text null: false
product references null: false, foreign_key: true
buyer references null: false, foreign_key: true
seller references null: false, foreign_key: true

Association

  • belongs_to :product
  • belongs_to :buyer, class_name: 'User', :foreign_key: 'buyer_id'
  • belongs_to :seller, class_name: 'User', foreign_key: 'seller_id

buy_valuesモデル

Column Type Options
rate integer null: false
comment text null: false
product references null: false, foreign_key: true
buyer references null: false, foreign_key: true
seller references null: false, foreign_key: true

Association

  • belongs_to :product
  • belongs_to :buyer, class_name: 'User', :foreign_key: 'buyer_id'
  • belongs_to :seller, class_name: 'User', foreign_key: 'seller_id

todosモデル

Column Type Options
message text null: false
dealing references foreign_key: true
user references foreign_key: true

Association

  • belongs_to :dealing
  • belongs_to :user

ratesテーブル

Column Type Options
rate string -------
user references null: false, foreign_key: true
comment text -------
現実装はここまで
dealing_id integer null: false

Association

  • belongs_to :user
  • belongs_to :dealing

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published