From 731aac740bc95e643b4e1899c0146afdb74cd539 Mon Sep 17 00:00:00 2001 From: Mike Munroe Date: Thu, 28 Feb 2013 16:42:39 -0500 Subject: [PATCH 01/11] change log4r link to most recent, updated location --- activerecord/README.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/README.rdoc b/activerecord/README.rdoc index 9fc6785d99..ed1e171d58 100644 --- a/activerecord/README.rdoc +++ b/activerecord/README.rdoc @@ -130,7 +130,7 @@ A short rundown of some of the major features: SQLite3[link:classes/ActiveRecord/ConnectionAdapters/SQLite3Adapter.html]. -* Logging support for Log4r[http://log4r.sourceforge.net] and Logger[http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc]. +* Logging support for Log4r[http://log4r.rubyforge.org] and Logger[http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc]. ActiveRecord::Base.logger = ActiveSupport::Logger.new(STDOUT) ActiveRecord::Base.logger = Log4r::Logger.new('Application Log') From bbe6948bb563593add246bbf98587467d55afcae Mon Sep 17 00:00:00 2001 From: Mike Munroe Date: Thu, 28 Feb 2013 16:52:07 -0500 Subject: [PATCH 02/11] fix broken links to README docs in intro --- README.rdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rdoc b/README.rdoc index bb9c418e0b..55b5efc916 100644 --- a/README.rdoc +++ b/README.rdoc @@ -18,7 +18,7 @@ you to present the data from database rows as objects and embellish these data o with business logic methods. Although most Rails models are backed by a database, models can also be ordinary Ruby classes, or Ruby classes that implement a set of interfaces as provided by the ActiveModel module. You can read more about Active Record in its -{README}[link:/rails/rails/blob/master/activerecord/README.rdoc]. +{README}[link:/activerecord/README.rdoc]. The Controller layer is responsible for handling incoming HTTP requests and providing a suitable response. Usually this means returning \HTML, but Rails controllers can also @@ -29,7 +29,7 @@ In Rails, the Controller and View layers are handled together by Action Pack. These two layers are bundled in a single package due to their heavy interdependence. This is unlike the relationship between Active Record and Action Pack, which are independent. Each of these packages can be used independently outside of Rails. You -can read more about Action Pack in its {README}[link:/rails/rails/blob/master/actionpack/README.rdoc]. +can read more about Action Pack in its {README}[link:/actionpack/README.rdoc]. == Getting Started From baa32a57f9f1e146fd0d23b71b38d0d40fd00c99 Mon Sep 17 00:00:00 2001 From: Trent Michaels Date: Fri, 1 Mar 2013 12:08:12 -0500 Subject: [PATCH 03/11] Clarified need to remove existing code in welcome index. Signed-off-by: Chelsea Macaluso --- guides/source/getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index 87f5e43157..c0cb5b0da9 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -208,7 +208,7 @@ create app/assets/stylesheets/welcome.css.scss Most important of these are of course the controller, located at `app/controllers/welcome_controller.rb` and the view, located at `app/views/welcome/index.html.erb`. -Open the `app/views/welcome/index.html.erb` file in your text editor and edit it to contain a single line of code: +Open the `app/views/welcome/index.html.erb` file in your text editor. Delete all of the existing code in the file, and replace it with the following single line of code: ```html

Hello, Rails!

From f8461f73c77c186ad0aa735fe9877990bffe1990 Mon Sep 17 00:00:00 2001 From: Chelsea Macaluso Date: Fri, 1 Mar 2013 12:32:40 -0500 Subject: [PATCH 04/11] Clarified removal of public/index.html file Signed-off-by: Trent Michaels --- guides/source/getting_started.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index c0cb5b0da9..95490b5e35 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -241,6 +241,8 @@ root to: "welcome#index" The `root to: "welcome#index"` tells Rails to map requests to the root of the application to the welcome controller's index action and `get "welcome/index"` tells Rails to map requests to to the welcome controller's index action. This was created earlier when you ran the controller generator (`rails generate controller welcome index`). +You should also remove the `public/index.html` file because it might otherwise take precedence over the routes defined in `config/routes.rb`. + If you navigate to in your browser, you'll see the `Hello, Rails!` message you put into `app/views/welcome/index.html.erb`, indicating that this new route is indeed going to `WelcomeController`'s `index` action and is rendering the view correctly. TIP: For more information about routing, refer to [Rails Routing from the Outside In](routing.html). From a243f84b5ddbd12675e6354ed9f99f23241aaeed Mon Sep 17 00:00:00 2001 From: Christine Hertzel Date: Fri, 1 Mar 2013 13:05:00 -0500 Subject: [PATCH 05/11] Fixed grammatical error and simplified paragraph concerning controllers. Signed-off-by: Chelsea Macaluso --- guides/source/getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index 95490b5e35..742b8ae548 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -280,7 +280,7 @@ With the route defined, requests can now be made to `/posts/new` in the applicat ![Another routing error, uninitialized constant PostsController](images/getting_started/routing_error_no_controller.png) -This error is happening because this route need a controller to be defined. The route is attempting to find that controller so it can serve the request, but with the controller undefined, it just can't do that. The solution to this particular problem is simple: you need to create a controller called `PostsController`. You can do this by running this command: +This error occurs because the route needs to have a controller defined in order to serve the request. The solution to this particular problem is simple: create a controller called `PostsController`. You can do this by running this command: ```bash $ rails g controller posts From 3dde99d01c71dad36e483d0d1957639fde255c27 Mon Sep 17 00:00:00 2001 From: Christine Hertzel Date: Fri, 1 Mar 2013 14:26:54 -0500 Subject: [PATCH 06/11] Reverting commit regarding public/index.html (no longer in Rails 4.) This reverts commit f8461f73c77c186ad0aa735fe9877990bffe1990. --- guides/source/getting_started.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index 742b8ae548..a1d7e955c8 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -241,8 +241,6 @@ root to: "welcome#index" The `root to: "welcome#index"` tells Rails to map requests to the root of the application to the welcome controller's index action and `get "welcome/index"` tells Rails to map requests to to the welcome controller's index action. This was created earlier when you ran the controller generator (`rails generate controller welcome index`). -You should also remove the `public/index.html` file because it might otherwise take precedence over the routes defined in `config/routes.rb`. - If you navigate to in your browser, you'll see the `Hello, Rails!` message you put into `app/views/welcome/index.html.erb`, indicating that this new route is indeed going to `WelcomeController`'s `index` action and is rendering the view correctly. TIP: For more information about routing, refer to [Rails Routing from the Outside In](routing.html). From b7d50f352fc8918cc63dc6bb0f3e3d77fb7420cc Mon Sep 17 00:00:00 2001 From: David Deller Date: Fri, 1 Mar 2013 18:05:18 -0500 Subject: [PATCH 07/11] Add explanation of :dependent => :restrict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on information here: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-has_many --- guides/source/association_basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md index dd59e2a8df..cb0a7c8026 100644 --- a/guides/source/association_basics.md +++ b/guides/source/association_basics.md @@ -845,7 +845,7 @@ Counter cache columns are added to the containing model's list of read-only attr ##### `:dependent` -If you set the `:dependent` option to `:destroy`, then deleting this object will call the `destroy` method on the associated object to delete that object. If you set the `:dependent` option to `:delete`, then deleting this object will delete the associated object _without_ calling its `destroy` method. +If you set the `:dependent` option to `:destroy`, then deleting this object will call the `destroy` method on the associated object to delete that object. If you set the `:dependent` option to `:delete`, then deleting this object will delete the associated object _without_ calling its `destroy` method. If you set the `:dependent` option to `:restrict`, then attempting to delete this object will result in a `ActiveRecord::DeleteRestrictionError` if there are any associated objects. WARNING: You should not specify this option on a `belongs_to` association that is connected with a `has_many` association on the other class. Doing so can lead to orphaned records in your database. From 50b3b968d481a6cef9122b2e3fe33f61b8f44179 Mon Sep 17 00:00:00 2001 From: Lebin Sebastian F Date: Mon, 4 Mar 2013 13:23:23 +0530 Subject: [PATCH 08/11] Small Typo --- activemodel/lib/active_model/conversion.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activemodel/lib/active_model/conversion.rb b/activemodel/lib/active_model/conversion.rb index 1f5d23dd8e..21e4eb3c86 100644 --- a/activemodel/lib/active_model/conversion.rb +++ b/activemodel/lib/active_model/conversion.rb @@ -1,5 +1,5 @@ module ActiveModel - # == Active \Model Conversions + # == Active \Model Conversion # # Handles default conversions: to_model, to_key, to_param, and to_partial_path. # From 0c3998782b455c81a0cb857a7bd4c90c5ab2e821 Mon Sep 17 00:00:00 2001 From: Ernie Miller Date: Mon, 4 Mar 2013 19:02:24 -0500 Subject: [PATCH 09/11] Fix WhereChain docs to mention only not --- activerecord/lib/active_record/relation/query_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 4b8c40592e..5076ae8a76 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -5,7 +5,7 @@ module ActiveRecord extend ActiveSupport::Concern # WhereChain objects act as placeholder for queries in which #where does not have any parameter. - # In this case, #where must be chained with either #not, #like, or #not_like to return a new relation. + # In this case, #where must be chained with #not to return a new relation. class WhereChain def initialize(scope) @scope = scope From 55269f9849154b20cfb927cb8db246c1b2270207 Mon Sep 17 00:00:00 2001 From: Jonathan Roes Date: Tue, 5 Mar 2013 00:15:07 -0500 Subject: [PATCH 10/11] Remove reference to BugMash. Link hasn't been updated in 4 years. --- guides/source/contributing_to_ruby_on_rails.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/guides/source/contributing_to_ruby_on_rails.md b/guides/source/contributing_to_ruby_on_rails.md index 7909a00c47..cc4e369e7d 100644 --- a/guides/source/contributing_to_ruby_on_rails.md +++ b/guides/source/contributing_to_ruby_on_rails.md @@ -250,8 +250,6 @@ Your name can be added directly after the last word if you don't provide any cod You should not be the only person who looks at the code before you submit it. You know at least one other Rails developer, right? Show them what you’re doing and ask for feedback. Doing this in private before you push a patch out publicly is the “smoke test” for a patch: if you can’t convince one other developer of the beauty of your code, you’re unlikely to convince the core team either. -You might want also to check out the [RailsBridge BugMash](http://wiki.railsbridge.org/projects/railsbridge/wiki/BugMash) as a way to get involved in a group effort to improve Rails. This can help you get started and help you check your code when you're writing your first patches. - ### Commit Your Changes When you're happy with the code on your computer, you need to commit the changes to Git: From b9b609e00d534b7203a443205e1db7ec9a3ddba8 Mon Sep 17 00:00:00 2001 From: Carson McDonald Date: Tue, 5 Mar 2013 07:10:41 -0500 Subject: [PATCH 11/11] Fix typo --- activerecord/lib/active_record/associations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 513d1012ba..35e4eb19a4 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1115,7 +1115,7 @@ module ActiveRecord # :dependent behavior may affect other callbacks. # # * :destroy causes all the associated objects to also be destroyed - # * :delete_all causes all the asssociated objects to be deleted directly from the database (so callbacks will not execute) + # * :delete_all causes all the associated objects to be deleted directly from the database (so callbacks will not execute) # * :nullify causes the foreign keys to be set to +NULL+. Callbacks are not executed. # * :restrict_with_exception causes an exception to be raised if there are any associated records # * :restrict_with_error causes an error to be added to the owner if there are any associated objects