From 2497fd90f45231c969d8fab772ebcaa252a288c6 Mon Sep 17 00:00:00 2001 From: Alexey Vakhov Date: Thu, 26 Apr 2012 18:32:01 +0400 Subject: Fix misprints in assert_file & assert_instance_method docs --- railties/lib/rails/generators/test_case.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/railties/lib/rails/generators/test_case.rb b/railties/lib/rails/generators/test_case.rb index 2cb34fab7a..508e221c60 100644 --- a/railties/lib/rails/generators/test_case.rb +++ b/railties/lib/rails/generators/test_case.rb @@ -79,8 +79,8 @@ module Rails # # Finally, when a block is given, it yields the file content: # - # assert_file "app/controller/products_controller.rb" do |controller| - # assert_instance_method :index, content do |index| + # assert_file "app/controllers/products_controller.rb" do |controller| + # assert_instance_method :index, controller do |index| # assert_match(/Product\.all/, index) # end # end @@ -159,8 +159,8 @@ module Rails # Asserts the given method exists in the given content. When a block is given, # it yields the content of the method. # - # assert_file "app/controller/products_controller.rb" do |controller| - # assert_instance_method :index, content do |index| + # assert_file "app/controllers/products_controller.rb" do |controller| + # assert_instance_method :index, controller do |index| # assert_match(/Product\.all/, index) # end # end -- cgit v1.2.3 From 8bf97d1a845385290f20f76ea1256712c2c4735e Mon Sep 17 00:00:00 2001 From: Jonathan Roes Date: Thu, 26 Apr 2012 15:47:48 -0300 Subject: Minor typo. --- guides/source/getting_started.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/getting_started.textile b/guides/source/getting_started.textile index fae12f825d..d2127b973d 100644 --- a/guides/source/getting_started.textile +++ b/guides/source/getting_started.textile @@ -465,7 +465,7 @@ invoking the command: rake db:migrate RAILS_ENV=production. h4. Saving data in the controller -Back into +posts_controller+, we need to change the +create+ action +Back in +posts_controller+, we need to change the +create+ action to use the new +Post+ model to save data in the database. Open that file and change the +create+ action to look like the following: -- cgit v1.2.3 From 504e539166ab3528e6377ae8bcf5ddacb3572729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rory=20O=E2=80=99Kane?= Date: Thu, 26 Apr 2012 18:24:38 -0300 Subject: Active Support Core Extensions guide: reworded "on one hand" and similar to "for one thing" --- guides/source/active_support_core_extensions.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/active_support_core_extensions.textile b/guides/source/active_support_core_extensions.textile index 5d0a3f82e8..e4a6e145b9 100644 --- a/guides/source/active_support_core_extensions.textile +++ b/guides/source/active_support_core_extensions.textile @@ -1131,7 +1131,7 @@ h4. Output Safety h5. Motivation -Inserting data into HTML templates needs extra care. For example you can't just interpolate +@review.title+ verbatim into an HTML page. On one hand if the review title is "Flanagan & Matz rules!" the output won't be well-formed because an ampersand has to be escaped as "&amp;". On the other hand, depending on the application that may be a big security hole because users can inject malicious HTML setting a hand-crafted review title. Check out the "section about cross-site scripting in the Security guide":security.html#cross-site-scripting-xss for further information about the risks. +Inserting data into HTML templates needs extra care. For example, you can't just interpolate +@review.title+ verbatim into an HTML page. For one thing, if the review title is "Flanagan & Matz rules!" the output won't be well-formed because an ampersand has to be escaped as "&amp;". What's more, depending on the application, that may be a big security hole because users can inject malicious HTML setting a hand-crafted review title. Check out the "section about cross-site scripting in the Security guide":security.html#cross-site-scripting-xss for further information about the risks. h5. Safe Strings -- cgit v1.2.3 From 8cc4159018929fb4b0aa431b7041f6a66f160180 Mon Sep 17 00:00:00 2001 From: Mark Rushakof Date: Fri, 27 Apr 2012 00:00:30 -0700 Subject: Use Foo::Bar instead of +Foo::Bar+ The latter doesn't render as code in HTML output. Regex used in Rubymine to locate the latter form: (\+)(:*\w+:(?::|\w)+)(\+) --- actionmailer/lib/action_mailer/base.rb | 2 +- actionpack/lib/action_controller/metal/params_wrapper.rb | 2 +- actionpack/lib/action_controller/metal/streaming.rb | 6 +++--- activemodel/lib/active_model/serialization.rb | 2 +- railties/lib/rails/configuration.rb | 2 +- railties/lib/rails/paths.rb | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index c508512ff6..2da3b344ba 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -486,7 +486,7 @@ module ActionMailer #:nodoc: self.class.mailer_name end - # Allows you to pass random and unusual headers to the new +Mail::Message+ object + # Allows you to pass random and unusual headers to the new Mail::Message object # which will add them to itself. # # headers['X-Special-Domain-Specific-Header'] = "SecretValue" diff --git a/actionpack/lib/action_controller/metal/params_wrapper.rb b/actionpack/lib/action_controller/metal/params_wrapper.rb index fa760f2658..17e2db74d4 100644 --- a/actionpack/lib/action_controller/metal/params_wrapper.rb +++ b/actionpack/lib/action_controller/metal/params_wrapper.rb @@ -66,7 +66,7 @@ module ActionController # class Admin::UsersController < ApplicationController # end # - # will try to check if +Admin::User+ or +User+ model exists, and use it to + # will try to check if Admin::User or +User+ model exists, and use it to # determine the wrapper key respectively. If both models don't exist, # it will then fallback to use +user+ as the key. module ParamsWrapper diff --git a/actionpack/lib/action_controller/metal/streaming.rb b/actionpack/lib/action_controller/metal/streaming.rb index 52aaed0ed4..eeb37db2e7 100644 --- a/actionpack/lib/action_controller/metal/streaming.rb +++ b/actionpack/lib/action_controller/metal/streaming.rb @@ -139,17 +139,17 @@ module ActionController #:nodoc: # session or flash after the template starts rendering will not propagate # to the client. # - # If you try to modify cookies, session or flash, an +ActionDispatch::ClosedError+ + # If you try to modify cookies, session or flash, an ActionDispatch::ClosedError # will be raised, showing those objects are closed for modification. # # == Middlewares # # Middlewares that need to manipulate the body won't work with streaming. # You should disable those middlewares whenever streaming in development - # or production. For instance, +Rack::Bug+ won't work when streaming as it + # or production. For instance, Rack::Bug won't work when streaming as it # needs to inject contents in the HTML body. # - # Also +Rack::Cache+ won't work with streaming as it does not support + # Also Rack::Cache won't work with streaming as it does not support # streaming bodies yet. Whenever streaming Cache-Control is automatically # set to "no-cache". # diff --git a/activemodel/lib/active_model/serialization.rb b/activemodel/lib/active_model/serialization.rb index a5828476b1..4403ef060b 100644 --- a/activemodel/lib/active_model/serialization.rb +++ b/activemodel/lib/active_model/serialization.rb @@ -34,7 +34,7 @@ module ActiveModel # # Most of the time though, you will want to include the JSON or XML # serializations. Both of these modules automatically include the - # +ActiveModel::Serialization+ module, so there is no need to explicitly + # ActiveModel::Serialization module, so there is no need to explicitly # include it. # # A minimal implementation including XML and JSON would be: diff --git a/railties/lib/rails/configuration.rb b/railties/lib/rails/configuration.rb index d8ca6cbd21..493eacdc5a 100644 --- a/railties/lib/rails/configuration.rb +++ b/railties/lib/rails/configuration.rb @@ -16,7 +16,7 @@ module Rails # # config.middleware.use Magical::Unicorns # - # This will put the +Magical::Unicorns+ middleware on the end of the stack. + # This will put the Magical::Unicorns middleware on the end of the stack. # You can use +insert_before+ if you wish to add a middleware before another: # # config.middleware.insert_before ActionDispatch::Head, Magical::Unicorns diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index dd1790299d..9b4a69f19f 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -8,7 +8,7 @@ module Rails # root.add "app/controllers", :eager_load => true # # The command above creates a new root object and add "app/controllers" as a path. - # This means we can get a +Rails::Paths::Path+ object back like below: + # This means we can get a Rails::Paths::Path object back like below: # # path = root["app/controllers"] # path.eager_load? # => true -- cgit v1.2.3 From ff44c3352d299b9e3c458988fa6f1e320c682444 Mon Sep 17 00:00:00 2001 From: Mark Rushakoff Date: Fri, 27 Apr 2012 00:25:22 -0700 Subject: Fix it's -> its --- actionmailer/lib/action_mailer/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 2da3b344ba..e24a7f52d5 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -497,7 +497,7 @@ module ActionMailer #:nodoc: # headers 'X-Special-Domain-Specific-Header' => "SecretValue", # 'In-Reply-To' => incoming.message_id # - # The resulting Mail::Message will have the following in it's header: + # The resulting Mail::Message will have the following in its header: # # X-Special-Domain-Specific-Header: SecretValue def headers(args=nil) -- cgit v1.2.3 From 39574aa582337baa32a58caae7b2671cb52ae718 Mon Sep 17 00:00:00 2001 From: Bernat Foj Capell Date: Fri, 27 Apr 2012 11:12:40 +0200 Subject: find_by_sql actually triggers after_find --- guides/source/active_record_validations_callbacks.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/active_record_validations_callbacks.textile b/guides/source/active_record_validations_callbacks.textile index 88c4481e5e..f49d91fd3c 100644 --- a/guides/source/active_record_validations_callbacks.textile +++ b/guides/source/active_record_validations_callbacks.textile @@ -1064,6 +1064,7 @@ Additionally, the +after_find+ callback is triggered by the following finder met * +find_all_by_attribute+ * +find_by_attribute+ * +find_by_attribute!+ +* +find_by_sql+ * +last+ The +after_initialize+ callback is triggered every time a new object of the class is initialized. @@ -1076,7 +1077,6 @@ Just as with validations, it is also possible to skip callbacks. These methods s * +decrement_counter+ * +delete+ * +delete_all+ -* +find_by_sql+ * +increment+ * +increment_counter+ * +toggle+ -- cgit v1.2.3