Repository files navigation
Column
Type
Options
nickname
string
null: false
email
string
null: false, unique: true
encrypted_password
string
null: false,
last_name
string
null: false
first_name
string
null: false
last_name_kana
string
null: false
first_name_kana
string
null: false
birth_date
date
null: false
has_many :buyed_items, foreign_key: "buyer_id", class_name: "Item", dependent: :destroy
has_many :saling_items, -> {where("buyer_id is NULL")}, foreign_key: "saler_id", class_name: "Item"
has_many :sold_items, -> {where("buyer_id is not NULL")}, foreign_key: "saler_id", class_name: "Item"
has_many :orders
Column
Type
Options
saler-id
references
null: false, FK: true
name
string
null: false
discription
text
null: false
category_id
integer
null: false
status_id
integer
null: false
payer_id
integer
null: false
prefecture_id
integer
null: false
shipping_day_id
integer
null: false
price
integer
null: false
buyer-id
integer
belongs_to :saler, class_name: "User", optional: true
belongs_to :buyer, class_name: "User", optional: true
has_one :order
belongs_to_active_hash :category
belongs_to_active_hash :status
belongs_to_active_hash :payer
belongs_to_active_hash :shipping_day
belongs_to_active_hash :prefecture
Column
Type
Options
order
references
null: false, FK: true
postal_code
string
null: false
prefecture_id
integer
null: false
city
string
null: false
address
string
null: false
building
string
phone_number
string
null: false, unique: true
belongs_to_active_hash :prefecture
belongs_to :order, optional: true
Column
Type
Options
user
references
null: false, FK: true
item
references
null: false, FK: true
belongs_to :user, optional: true
belongs_to :item, optional: true
has_one :address
You can’t perform that action at this time.