From f847f342f4958fe5c81fec37d9f661164ca771d8 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Sun, 14 Feb 2016 13:11:31 +0900 Subject: [ci skip] Update 'Testing Active Record' Follow up 8c629bf463b47643712570d4511a68b9a3da1476. `bundle exec rake test` in 'activerecord' runs tests for * sqlite3 * mysql2 * postgresql --- guides/source/contributing_to_ruby_on_rails.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/contributing_to_ruby_on_rails.md b/guides/source/contributing_to_ruby_on_rails.md index 0f98d12217..12d0280116 100644 --- a/guides/source/contributing_to_ruby_on_rails.md +++ b/guides/source/contributing_to_ruby_on_rails.md @@ -367,7 +367,7 @@ Finally, $ bundle exec rake test ``` -will now run the four of them in turn. +will now run the three of them in turn. You can also run any single test separately: -- cgit v1.2.3 From c0bbfdb48e897a166c0c59337c6c493a61b3a21f Mon Sep 17 00:00:00 2001 From: Mikhail Dieterle Date: Sun, 14 Feb 2016 19:17:03 +0300 Subject: [ci skip] fix typos --- guides/source/association_basics.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'guides') diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md index 3386791cdb..e692ae95bc 100644 --- a/guides/source/association_basics.md +++ b/guides/source/association_basics.md @@ -713,7 +713,7 @@ By default, Active Record doesn't know about the connection between these associ ```ruby a = Author.first -b = c.books.first +b = a.books.first a.first_name == b.author.first_name # => true a.first_name = 'Manny' a.first_name == b.author.first_name # => false @@ -734,8 +734,8 @@ end With these changes, Active Record will only load one copy of the author object, preventing inconsistencies and making your application more efficient: ```ruby -a = author.first -b = c.books.first +a = Author.first +b = a.books.first a.first_name == b.author.first_name # => true a.first_name = 'Manny' a.first_name == b.author.first_name # => true -- cgit v1.2.3 From a9f50f87c38659d0e9425f86f613cf5328d55d27 Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Fri, 26 Feb 2016 15:52:21 +0530 Subject: [ci skip] Remove reference to Rails 4 in the initialization guide. --- guides/source/documents.yaml | 2 +- guides/source/initialization.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'guides') diff --git a/guides/source/documents.yaml b/guides/source/documents.yaml index fdd6d4d33d..a3f2339114 100644 --- a/guides/source/documents.yaml +++ b/guides/source/documents.yaml @@ -116,7 +116,7 @@ name: The Rails Initialization Process work_in_progress: true url: initialization.html - description: This guide explains the internals of the Rails initialization process as of Rails 4. + description: This guide explains the internals of the Rails initialization process. - name: Autoloading and Reloading Constants url: autoloading_and_reloading_constants.html diff --git a/guides/source/initialization.md b/guides/source/initialization.md index 156f9c92b4..c753586aa5 100644 --- a/guides/source/initialization.md +++ b/guides/source/initialization.md @@ -3,8 +3,8 @@ The Rails Initialization Process ================================ -This guide explains the internals of the initialization process in Rails -as of Rails 4. It is an extremely in-depth guide and recommended for advanced Rails developers. +This guide explains the internals of the initialization process in Rails. +It is an extremely in-depth guide and recommended for advanced Rails developers. After reading this guide, you will know: -- cgit v1.2.3 From d3b1eccff996811e05c28c0f288662caad864bb5 Mon Sep 17 00:00:00 2001 From: Mikhail Dieterle Date: Sat, 27 Feb 2016 09:25:35 +0300 Subject: [ci skip] fix json output --- guides/source/action_view_overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/action_view_overview.md b/guides/source/action_view_overview.md index 543937f8e5..26e62b5971 100644 --- a/guides/source/action_view_overview.md +++ b/guides/source/action_view_overview.md @@ -173,7 +173,7 @@ would produce: ```json { "name": "Alex", - "email: "alex@example.com" + "email": "alex@example.com" } ``` -- cgit v1.2.3 From 14867b1a9af813b0147bba2ae06675137d61d77b Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Thu, 3 Mar 2016 10:32:42 +0530 Subject: [ci skip] Update getting started guide for chanages in migrations API - We no longer add `null: false` for timestamps columns as per https://github.com/rails/rails/commit/a939506f297b667291480f26fa32a373a18ae06a. - Similarly `references` and `belongs_to` columns no longer mention `index: true` in migration files. It's added by default as per https://github.com/rails/rails/commit/909818b93b8f1bd4d7053a1c5d8135b9b0cbe865. --- guides/source/getting_started.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'guides') diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index 2cbc591629..3152d375c4 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -686,7 +686,7 @@ class CreateArticles < ActiveRecord::Migration[5.0] t.string :title t.text :text - t.timestamps null: false + t.timestamps end end end @@ -1554,9 +1554,9 @@ class CreateComments < ActiveRecord::Migration[5.0] create_table :comments do |t| t.string :commenter t.text :body - t.references :article, index: true, foreign_key: true + t.references :article, foreign_key: true - t.timestamps null: false + t.timestamps end end end -- cgit v1.2.3 From b5bdcaa838bb85cf0fdfdaef036409ab3a8d4a91 Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Thu, 3 Mar 2016 13:54:04 +0530 Subject: [ci skip] Update all guides with `null: false` change in migrations - We no longer add `null: false` for timestamps columns as per rails/rails@a939506. - Followup of https://github.com/rails/docrails/commit/14867b1a9af813b0147bba2ae06675137d61d77b. --- guides/source/active_record_basics.md | 2 +- guides/source/active_record_migrations.md | 6 ++--- guides/source/association_basics.md | 38 +++++++++++++++---------------- 3 files changed, 23 insertions(+), 23 deletions(-) (limited to 'guides') diff --git a/guides/source/active_record_basics.md b/guides/source/active_record_basics.md index fba89f9d13..d9e9466a33 100644 --- a/guides/source/active_record_basics.md +++ b/guides/source/active_record_basics.md @@ -361,7 +361,7 @@ class CreatePublications < ActiveRecord::Migration[5.0] t.string :publisher_type t.boolean :single_issue - t.timestamps null: false + t.timestamps end add_index :publications, :publication_type_id end diff --git a/guides/source/active_record_migrations.md b/guides/source/active_record_migrations.md index 83f4b951ee..5721071785 100644 --- a/guides/source/active_record_migrations.md +++ b/guides/source/active_record_migrations.md @@ -41,7 +41,7 @@ class CreateProducts < ActiveRecord::Migration[5.0] t.string :name t.text :description - t.timestamps null: false + t.timestamps end end end @@ -287,7 +287,7 @@ class CreateProducts < ActiveRecord::Migration[5.0] t.string :name t.text :description - t.timestamps null: false + t.timestamps end end end @@ -847,7 +847,7 @@ class CreateProducts < ActiveRecord::Migration[5.0] create_table :products do |t| t.string :name t.text :description - t.timestamps null: false + t.timestamps end end diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md index e692ae95bc..0ffdf037f7 100644 --- a/guides/source/association_basics.md +++ b/guides/source/association_basics.md @@ -105,13 +105,13 @@ class CreateBooks < ActiveRecord::Migration[5.0] def change create_table :authors do |t| t.string :name - t.timestamps null: false + t.timestamps end create_table :books do |t| t.belongs_to :author, index: true t.datetime :published_at - t.timestamps null: false + t.timestamps end end end @@ -136,13 +136,13 @@ class CreateSuppliers < ActiveRecord::Migration[5.0] def change create_table :suppliers do |t| t.string :name - t.timestamps null: false + t.timestamps end create_table :accounts do |t| t.belongs_to :supplier, index: true t.string :account_number - t.timestamps null: false + t.timestamps end end end @@ -180,13 +180,13 @@ class CreateAuthors < ActiveRecord::Migration[5.0] def change create_table :authors do |t| t.string :name - t.timestamps null: false + t.timestamps end create_table :books do |t| t.belongs_to :author, index: true t.datetime :published_at - t.timestamps null: false + t.timestamps end end end @@ -222,19 +222,19 @@ class CreateAppointments < ActiveRecord::Migration[5.0] def change create_table :physicians do |t| t.string :name - t.timestamps null: false + t.timestamps end create_table :patients do |t| t.string :name - t.timestamps null: false + t.timestamps end create_table :appointments do |t| t.belongs_to :physician, index: true t.belongs_to :patient, index: true t.datetime :appointment_date - t.timestamps null: false + t.timestamps end end end @@ -308,19 +308,19 @@ class CreateAccountHistories < ActiveRecord::Migration[5.0] def change create_table :suppliers do |t| t.string :name - t.timestamps null: false + t.timestamps end create_table :accounts do |t| t.belongs_to :supplier, index: true t.string :account_number - t.timestamps null: false + t.timestamps end create_table :account_histories do |t| t.belongs_to :account, index: true t.integer :credit_rating - t.timestamps null: false + t.timestamps end end end @@ -349,12 +349,12 @@ class CreateAssembliesAndParts < ActiveRecord::Migration[5.0] def change create_table :assemblies do |t| t.string :name - t.timestamps null: false + t.timestamps end create_table :parts do |t| t.string :part_number - t.timestamps null: false + t.timestamps end create_table :assemblies_parts, id: false do |t| @@ -388,13 +388,13 @@ class CreateSuppliers < ActiveRecord::Migration[5.0] def change create_table :suppliers do |t| t.string :name - t.timestamps null: false + t.timestamps end create_table :accounts do |t| t.integer :supplier_id t.string :account_number - t.timestamps null: false + t.timestamps end add_index :accounts, :supplier_id @@ -472,7 +472,7 @@ class CreatePictures < ActiveRecord::Migration[5.0] t.string :name t.integer :imageable_id t.string :imageable_type - t.timestamps null: false + t.timestamps end add_index :pictures, [:imageable_type, :imageable_id] @@ -488,7 +488,7 @@ class CreatePictures < ActiveRecord::Migration[5.0] create_table :pictures do |t| t.string :name t.references :imageable, polymorphic: true, index: true - t.timestamps null: false + t.timestamps end end end @@ -518,7 +518,7 @@ class CreateEmployees < ActiveRecord::Migration[5.0] def change create_table :employees do |t| t.references :manager, index: true - t.timestamps null: false + t.timestamps end end end -- cgit v1.2.3