teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

ReadMeを追加しました。

2020/03/18 08:34

投稿

ryongon
ryongon

スコア5

title CHANGED
File without changes
body CHANGED
@@ -182,5 +182,155 @@
182
182
  end
183
183
  ```
184
184
 
185
+ ```readme
186
+ # freemarket_sample_70f
187
+ ## usersテーブル
188
+ |Column|Type|Options|
189
+ |------|----|-------|
190
+ |nickname|string|null: false|
191
+ |email|string|null: false, unique, true, index: ture|
192
+ |password|string|null: false|
193
+ |password_confirmation|string|null: false|
194
+ |family_name|string|null: false|
195
+ |first_name|string|null: false|
196
+ |family_name_kana|string|null: false|
197
+ |first_name_kana|string|null: false|
198
+ |birth_year|integer|null: false|
199
+ |birth_month|integer|null: false|
200
+ |birth_day|integer|null: false|
201
+
202
+
203
+ ### Association
204
+ - has_many : seller_items, foreign_key: "seller_id", class_name: "items"
205
+ - has_many : buyer_items, foreign_key: "buyer_id", class_name: "items"
206
+ - has_one : destination, dependent: :destory
207
+ - has_one : credit_card, dependent: :destroy
208
+
209
+
210
+
211
+ ## destinationsテーブル
212
+ |Column|Type|Options|
213
+ |------|----|-------|
214
+ |post_code|inteder|null: false|
215
+ |prefecture_code|integer|null: false|
216
+ |city|string|null: false|
217
+ |house_number|string|null: false|
218
+ |building_number|string||
219
+ |phone_number|string|
220
+ |user_id|integer|null: false, foreign_key: ture|
221
+ ### Association
222
+ - belongs_to :user
223
+ - Gem :jp_prefectureを使用して都道府県コードを取得
224
+
225
+
226
+ # credit_cardsテーブル
227
+ |Column|Type|Options|
228
+ |------|----|-------|
229
+ |customer_id|string|null: false|
230
+ |card_id|string|null: false|
231
+ |user_id|integer|null: false, foreign_key: true|
232
+ ### Association
233
+ - belongs_to :user
234
+
235
+ ## itemsテーブル
236
+ |Column|Type|Options|
237
+ |------|----|-------|
238
+ |name|string|null: false|
239
+ |introduction|text|null: false|
240
+ |price|integer|null: falce|
241
+ |brand_id|inteder|null: false, foreign_key: ture|
242
+ |condition_id|integer|null: false, foreign_key: ture|
243
+ |postage_payer_id|integer|null: false, foreign_key: true|
244
+ <!-- |postage_type_id|integer|null: false, foreign_key: true| -->
245
+ |prefecture_code|integer| null: false|
246
+ |preparation_day_id|integer|null: false, foreign_key: true|
247
+ |category_id|integer|null: false, foreign_key: true|
248
+ |trading_status|enum|null: false|
249
+ |user_id|integer|null: false, foreign_key: true|
250
+ |seller_id|integer|null: false, foreign_key: true|
251
+ |buyer_id|integer|foreign_key: true)
252
+ <!-- |deal_closed_date|timestamp|| -->
253
+
254
+
255
+ ### Association
256
+ - has_many :images, dependent: :destroy
257
+ - belongs_to :category
258
+ - belongs_to :brand
259
+ - belongs_to :active_hash :condition
260
+ - belongs_to :active_hash :postage_payer
261
+ <!-- - belongs_to :active_hash :postage_type -->
262
+ - belongs_to :active_hash :preparation_day
263
+ - belongs_to :seller, class_name: "User"
264
+ - belongs_to :buyer, class_name: "User"
265
+ - Gem :jp_prefectureを使用して都道府県コードを取得
266
+
267
+ ## imagesテーブル
268
+ |Column|Type|Options|
269
+ |------|----|-------|
270
+ |item_id|integer|null: false, foreign_key: true|
271
+ |url|string|null: false|
272
+ ### Association
273
+ - belongs_to :item
274
+
275
+ ## Categoriesテーブル
276
+ |Column|Type|Options|
277
+ |------|----|-------|
278
+ |name|string|null: false|
279
+ |ancestry|string|null: false|
280
+ ### Association
281
+ - has_many :items
282
+
283
+
284
+ ## brandsテーブル
285
+ |Column|Type|Options|
286
+ |------|----|-------|
287
+ |name|string||
288
+ ### Association
289
+ - has_many :items
290
+
291
+
292
+ ## sizes(active_hash)モデル
293
+ |Column|Type|Options|
294
+ |------|----|-------|
295
+ |size|string|null: false|
296
+ ### Association
297
+ - has_many :items
298
+
299
+ ## conditions(active_hash)モデル
300
+ |Column|Type|Options|
301
+ |------|----|-------|
302
+ |condition|string|null: false|
303
+ ### Association
304
+ - has_many :items
305
+
306
+ ## postage_payers(active_hash)モデル
307
+ |Column|Type|Options|
308
+ |------|----|-------|
309
+ |postage_payer|string|null: false|
310
+ ### Association
311
+ - has_many :items
312
+
313
+ ## preparation_days(active_hash)モデル
314
+ |Column|Type|Options|
315
+ |------|----|-------|
316
+ |preparation_day|string|null: false|
317
+ ### Association
318
+ - has_many :items
319
+
320
+ ## Postage_types(active_hash)モデル
321
+ |Column|Type|Options|
322
+ |------|----|-------|
323
+ |postage_type|string|null: false|
324
+ ### Association
325
+ - has_many :items
326
+
327
+ ## S3画像アップロード・条件分岐の現状
328
+ ⇨https://master.tech-camp.in/curriculums/3967
329
+ 進捗は上記のカリキュラムの「正しくアップロードできるか確認しよう」の前までは一応完了
330
+ ⇨https://qiita.com/15grmr/items/71859caea0414f2e245d
331
+ 上記は参考記事
332
+
333
+ ```
334
+
185
335
  # 現状のビュー(一部)
186
336
  https://gyazo.com/df2ef5e34231c52114b28704092beebb