Skip to content

Commit 247dd5e

Browse files
committed
Site updated @ Wed Apr 8 22:59:31 CST 2015
1 parent 25930d8 commit 247dd5e

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

active_record_basics.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ <h3 id="驗證">6 驗證</h3><p>Active Record 允許您在資料被存入資料
474474
t.string :publisher_type
475475
t.boolean :single_issue
476476

477-
t.timestamps
477+
t.timestamps null: false
478478
end
479479
add_index :publications, :publication_type_id
480480
end

active_record_migrations.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ <h3 id="綜覽">1 綜覽</h3><p>遷移是一種簡單、一致、方便<a href="
275275
t.string :name
276276
t.text :description
277277

278-
t.timestamps
278+
t.timestamps null: false
279279
end
280280
end
281281
end
@@ -466,7 +466,7 @@ <h4 id="model-產生器">2.2 Model 產生器</h4><p>Model 與鷹架產生器新
466466
t.string :name
467467
t.text :description
468468

469-
t.timestamps
469+
t.timestamps null: false
470470
end
471471
end
472472
end
@@ -832,7 +832,7 @@ <h4 id="修改遷移執行中的輸出">4.6 修改遷移執行中的輸出</h4><
832832
create_table :products do |t|
833833
t.string :name
834834
t.text :description
835-
t.timestamps
835+
t.timestamps null: false
836836
end
837837
end
838838

association_basics.html

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -329,13 +329,13 @@ <h3 id="為什麼需要關聯?">1 為什麼需要關聯?</h3><p>為什麼 Mo
329329
def change
330330
create_table :customers do |t|
331331
t.string :name
332-
t.timestamps
332+
t.timestamps null: false
333333
end
334334

335335
create_table :orders do |t|
336336
t.belongs_to :customer, index: true
337337
t.datetime :order_date
338-
t.timestamps
338+
t.timestamps null: false
339339
end
340340
end
341341
end
@@ -356,13 +356,13 @@ <h4 id="has-one-關聯">2.2 <code>has_one</code> 關聯</h4><p><code>has_one</co
356356
def change
357357
create_table :suppliers do |t|
358358
t.string :name
359-
t.timestamps
359+
t.timestamps null: false
360360
end
361361

362362
create_table :accounts do |t|
363363
t.belongs_to :supplier, index: true
364364
t.string :account_number
365-
t.timestamps
365+
t.timestamps null: false
366366
end
367367
end
368368
end
@@ -383,13 +383,13 @@ <h4 id="has-many-關聯">2.3 <code>has_many</code> 關聯</h4><p><code>has_many<
383383
def change
384384
create_table :customers do |t|
385385
t.string :name
386-
t.timestamps
386+
t.timestamps null: false
387387
end
388388

389389
create_table :orders do |t|
390390
t.belongs_to :customer, index: true
391391
t.datetime :order_date
392-
t.timestamps
392+
t.timestamps null: false
393393
end
394394
end
395395
end
@@ -421,19 +421,19 @@ <h4 id="has-many-through-關聯">2.4 <code>has_many :through</code> 關聯</h4><
421421
def change
422422
create_table :physicians do |t|
423423
t.string :name
424-
t.timestamps
424+
t.timestamps null: false
425425
end
426426

427427
create_table :patients do |t|
428428
t.string :name
429-
t.timestamps
429+
t.timestamps null: false
430430
end
431431

432432
create_table :appointments do |t|
433433
t.belongs_to :physician, index: true
434434
t.belongs_to :patient, index: true
435435
t.datetime :appointment_date
436-
t.timestamps
436+
t.timestamps null: false
437437
end
438438
end
439439
end
@@ -494,19 +494,19 @@ <h4 id="has-one-through-關聯">2.5 <code>has_one :through</code> 關聯</h4><p>
494494
def change
495495
create_table :suppliers do |t|
496496
t.string :name
497-
t.timestamps
497+
t.timestamps null: false
498498
end
499499

500500
create_table :accounts do |t|
501501
t.belongs_to :supplier, index: true
502502
t.string :account_number
503-
t.timestamps
503+
t.timestamps null: false
504504
end
505505

506506
create_table :account_histories do |t|
507507
t.belongs_to :account, index: true
508508
t.integer :credit_rating
509-
t.timestamps
509+
t.timestamps null: false
510510
end
511511
end
512512
end
@@ -531,12 +531,12 @@ <h4 id="has-and-belongs-to-many-關聯">2.6 <code>has_and_belongs_to_many</code>
531531
def change
532532
create_table :assemblies do |t|
533533
t.string :name
534-
t.timestamps
534+
t.timestamps null: false
535535
end
536536

537537
create_table :parts do |t|
538538
t.string :part_number
539-
t.timestamps
539+
t.timestamps null: false
540540
end
541541

542542
create_table :assemblies_parts, id: false do |t|
@@ -565,13 +565,13 @@ <h4 id="belongs-to-與-has-one-的應用場景">2.7 <code>belongs_to</code> 與
565565
def change
566566
create_table :suppliers do |t|
567567
t.string :name
568-
t.timestamps
568+
t.timestamps null: false
569569
end
570570

571571
create_table :accounts do |t|
572572
t.integer :supplier_id
573573
t.string :account_number
574-
t.timestamps
574+
t.timestamps null: false
575575
end
576576

577577
add_index :accounts, :supplier_id
@@ -635,7 +635,7 @@ <h4 id="belongs-to-與-has-one-的應用場景">2.7 <code>belongs_to</code> 與
635635
t.string :name
636636
t.integer :imageable_id
637637
t.string :imageable_type
638-
t.timestamps
638+
t.timestamps null: false
639639
end
640640

641641
add_index :pictures, :imageable_id
@@ -651,7 +651,7 @@ <h4 id="belongs-to-與-has-one-的應用場景">2.7 <code>belongs_to</code> 與
651651
create_table :pictures do |t|
652652
t.string :name
653653
t.references :imageable, polymorphic: true, index: true
654-
t.timestamps
654+
t.timestamps null: false
655655
end
656656
end
657657
end
@@ -675,7 +675,7 @@ <h4 id="belongs-to-與-has-one-的應用場景">2.7 <code>belongs_to</code> 與
675675
def change
676676
create_table :employees do |t|
677677
t.references :manager
678-
t.timestamps
678+
t.timestamps null: false
679679
end
680680
end
681681
end

getting_started.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ <h4 id="設置應用程式首頁">4.3 設置應用程式首頁</h4><p>現在我
624624
t.string :title
625625
t.text :text
626626

627-
t.timestamps
627+
t.timestamps null: false
628628
end
629629
end
630630
end
@@ -1241,7 +1241,7 @@ <h4 id="刪除文章">5.13 刪除文章</h4><p>現在我們要進入到 CRUD 的
12411241
# this line adds an integer column called `article_id`.
12421242
t.references :article, index: true
12431243

1244-
t.timestamps
1244+
t.timestamps null: false
12451245
end
12461246
end
12471247
end

0 commit comments

Comments
 (0)