From c89e6926a002c148af52d036f16c26f88a5f99d0 Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Tue, 5 Apr 2016 12:05:48 +0530 Subject: [ci skip] Update code used for filtering passwords in the configuring guide --- guides/source/configuring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/configuring.md b/guides/source/configuring.md index e80f994deb..57790e6d85 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -104,7 +104,7 @@ application. Accepts a valid week day symbol (e.g. `:monday`). * `config.filter_parameters` used for filtering out the parameters that you don't want shown in the logs, such as passwords or credit card -numbers. New applications filter out passwords by adding the following `config.filter_parameters+=[:password]` in `config/initializers/filter_parameter_logging.rb`. Parameters filter works by partial matching regular expression. +numbers. By default, Rails filters out passwords by adding `Rails.application.config.filter_parameters += [:password]` in `config/initializers/filter_parameter_logging.rb`. Parameters filter works by partial matching regular expression. * `config.force_ssl` forces all requests to be served over HTTPS by using the `ActionDispatch::SSL` middleware, and sets `config.action_mailer.default_url_options` to be `{ protocol: 'https' }`. This can be configured by setting `config.ssl_options` - see the [ActionDispatch::SSL documentation](http://edgeapi.rubyonrails.org/classes/ActionDispatch/SSL.html) for details. -- cgit v1.2.3 From 343e2647b39fa087444a94b6110e6d5809bc50eb Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Tue, 5 Apr 2016 20:55:58 +0530 Subject: [ci skip] Fix formatting of code snippet in Action Cable guide --- guides/source/action_cable_overview.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'guides') diff --git a/guides/source/action_cable_overview.md b/guides/source/action_cable_overview.md index 28578b3369..8d95072e87 100644 --- a/guides/source/action_cable_overview.md +++ b/guides/source/action_cable_overview.md @@ -39,7 +39,7 @@ client-server connection instance established per WebSocket connection. Connections form the foundation of the client-server relationship. For every WebSocket the cable server is accepting, a Connection object will be instantiated on the server side. -This instance becomes the parent of all the channel subscriptions that are created from there on. +This instance becomes the parent of all the channel subscriptions that are created from there on. The Connection itself does not deal with any specific application logic beyond authentication and authorization. The client of a WebSocket connection is called a consumer. An individual user will create one consumer-connection pair per browser tab, window, or device they have open. @@ -73,12 +73,12 @@ end ``` Here `identified_by` is a connection identifier that can be used to find the -specific connection later. Note that anything marked as an identifier will automatically +specific connection later. Note that anything marked as an identifier will automatically create a delegate by the same name on any channel instances created off the connection. This example relies on the fact that you will already have handled authentication of the user -somewhere else in your application, and that a successful authentication sets a signed -cookie with the `user_id`. +somewhere else in your application, and that a successful authentication sets a signed +cookie with the `user_id`. The cookie is then automatically sent to the connection instance when a new connection is attempted, and you use that to set the `current_user`. By identifying the connection @@ -89,8 +89,8 @@ or deauthorized). ### Channels A channel encapsulates a logical unit of work, similar to what a controller does in a -regular MVC setup. By default, Rails creates a parent `ApplicationCable::Channel` class -for encapsulating shared logic between your channels. +regular MVC setup. By default, Rails creates a parent `ApplicationCable::Channel` class +for encapsulating shared logic between your channels. #### Parent Channel Setup @@ -150,7 +150,7 @@ established using the following Javascript, which is generated by default in Rai App.cable = ActionCable.createConsumer() ``` -This will ready a consumer that'll connect against /cable on your server by default. +This will ready a consumer that'll connect against /cable on your server by default. The connection won't be established until you've also specified at least one subscription you're interested in having. @@ -215,6 +215,7 @@ If a consumer is not streaming (subscribed to a given channel), they'll not get the broadcast should they connect later. Broadcasts are called elsewhere in your Rails application: + ```ruby WebNotificationsChannel.broadcast_to current_user, title: 'New things!', body: 'All the news fit to print' ``` -- cgit v1.2.3 From 7ab5682ebe1ead09a415eccfae56cdcfea440e6f Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Sun, 10 Apr 2016 21:02:27 +0530 Subject: s/Thoughtbot/thoughtbot/ See https://github.com/thoughtbot/presskit/blob/master/README.md#name for name capitalization. [ci skip] --- guides/source/2_3_release_notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/2_3_release_notes.md b/guides/source/2_3_release_notes.md index 0a62f34371..30954a10b6 100644 --- a/guides/source/2_3_release_notes.md +++ b/guides/source/2_3_release_notes.md @@ -572,7 +572,7 @@ This will layer the changes from the template on top of whatever code the projec ### Quieter Backtraces -Building on Thoughtbot's [Quiet Backtrace](https://github.com/thoughtbot/quietbacktrace) plugin, which allows you to selectively remove lines from `Test::Unit` backtraces, Rails 2.3 implements `ActiveSupport::BacktraceCleaner` and `Rails::BacktraceCleaner` in core. This supports both filters (to perform regex-based substitutions on backtrace lines) and silencers (to remove backtrace lines entirely). Rails automatically adds silencers to get rid of the most common noise in a new application, and builds a `config/backtrace_silencers.rb` file to hold your own additions. This feature also enables prettier printing from any gem in the backtrace. +Building on thoughtbot's [Quiet Backtrace](https://github.com/thoughtbot/quietbacktrace) plugin, which allows you to selectively remove lines from `Test::Unit` backtraces, Rails 2.3 implements `ActiveSupport::BacktraceCleaner` and `Rails::BacktraceCleaner` in core. This supports both filters (to perform regex-based substitutions on backtrace lines) and silencers (to remove backtrace lines entirely). Rails automatically adds silencers to get rid of the most common noise in a new application, and builds a `config/backtrace_silencers.rb` file to hold your own additions. This feature also enables prettier printing from any gem in the backtrace. ### Faster Boot Time in Development Mode with Lazy Loading/Autoload -- cgit v1.2.3 From 72360dd11ac5f59973b8255ba459fb5ad111e1af Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Sun, 10 Apr 2016 23:50:49 +0530 Subject: - Fix typo in config guide, from config.logger section - Make bulleted lists, end properly [ci skip] --- guides/source/configuring.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'guides') diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 57790e6d85..549ec70603 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -116,7 +116,7 @@ defaults to `:debug` for all environments. The available log levels are: `:debug * `config.log_tags` accepts a list of: methods that the `request` object responds to, a `Proc` that accepts the `request` object, or something that responds to `to_s`. This makes it easy to tag log lines with debug information like subdomain and request id - both very helpful in debugging multi-user production applications. -* `config.logger` is the logger that will be used for `Rails.logger` and any related Rails logging such as `ActiveRecord::Base.logger`. It defaults to an instance of `ActiveSupport::TaggedLogging` that wraps an instance of `ActiveSupport::Logger` which outputs a log to the `log/` directory. You can supply a custom logger, to get full compatability you must follow these guidelines: +* `config.logger` is the logger that will be used for `Rails.logger` and any related Rails logging such as `ActiveRecord::Base.logger`. It defaults to an instance of `ActiveSupport::TaggedLogging` that wraps an instance of `ActiveSupport::Logger` which outputs a log to the `log/` directory. You can supply a custom logger, to get full compatibility you must follow these guidelines: * To support a formatter you must manually assign a formatter from the `config.log_formatter` value to the logger. * To support tagged loggs the log instance must be wrapped with `ActiveSupport::TaggedLogging`. * To support silencing the logger must include `LoggerSilence` and `ActiveSupport::LoggerThreadSafeLevel` modules. The `ActiveSupport::Logger` class already includes these modules. @@ -281,8 +281,8 @@ All these configuration options are delegated to the `I18n` library. * `config.active_record.logger` accepts a logger conforming to the interface of Log4r or the default Ruby Logger class, which is then passed on to any new database connections made. You can retrieve this logger by calling `logger` on either an Active Record model class or an Active Record model instance. Set to `nil` to disable logging. * `config.active_record.primary_key_prefix_type` lets you adjust the naming for primary key columns. By default, Rails assumes that primary key columns are named `id` (and this configuration option doesn't need to be set.) There are two other choices: - * `:table_name` would make the primary key for the Customer class `customerid` - * `:table_name_with_underscore` would make the primary key for the Customer class `customer_id` + * `:table_name` would make the primary key for the Customer class `customerid`. + * `:table_name_with_underscore` would make the primary key for the Customer class `customer_id`. * `config.active_record.table_name_prefix` lets you set a global string to be prepended to table names. If you set this to `northwest_`, then the Customer class will look for `northwest_customers` as its table. The default is an empty string. -- cgit v1.2.3 From 6ab0637da83429187b7191fac87cdce327e656cb Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Tue, 12 Apr 2016 13:43:21 +0530 Subject: [ci skip] Typo fix. `loggs` -> `logs` --- guides/source/configuring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 549ec70603..0838e2d74e 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -118,7 +118,7 @@ defaults to `:debug` for all environments. The available log levels are: `:debug * `config.logger` is the logger that will be used for `Rails.logger` and any related Rails logging such as `ActiveRecord::Base.logger`. It defaults to an instance of `ActiveSupport::TaggedLogging` that wraps an instance of `ActiveSupport::Logger` which outputs a log to the `log/` directory. You can supply a custom logger, to get full compatibility you must follow these guidelines: * To support a formatter you must manually assign a formatter from the `config.log_formatter` value to the logger. - * To support tagged loggs the log instance must be wrapped with `ActiveSupport::TaggedLogging`. + * To support tagged logs, the log instance must be wrapped with `ActiveSupport::TaggedLogging`. * To support silencing the logger must include `LoggerSilence` and `ActiveSupport::LoggerThreadSafeLevel` modules. The `ActiveSupport::Logger` class already includes these modules. ```ruby -- cgit v1.2.3 From ab4361698a7c632d368fa8259b7287e86345887a Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Tue, 12 Apr 2016 13:46:13 +0530 Subject: [ci skip] Add some missing commas --- guides/source/configuring.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guides') diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 0838e2d74e..50487a5356 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -117,9 +117,9 @@ defaults to `:debug` for all environments. The available log levels are: `:debug * `config.log_tags` accepts a list of: methods that the `request` object responds to, a `Proc` that accepts the `request` object, or something that responds to `to_s`. This makes it easy to tag log lines with debug information like subdomain and request id - both very helpful in debugging multi-user production applications. * `config.logger` is the logger that will be used for `Rails.logger` and any related Rails logging such as `ActiveRecord::Base.logger`. It defaults to an instance of `ActiveSupport::TaggedLogging` that wraps an instance of `ActiveSupport::Logger` which outputs a log to the `log/` directory. You can supply a custom logger, to get full compatibility you must follow these guidelines: - * To support a formatter you must manually assign a formatter from the `config.log_formatter` value to the logger. + * To support a formatter, you must manually assign a formatter from the `config.log_formatter` value to the logger. * To support tagged logs, the log instance must be wrapped with `ActiveSupport::TaggedLogging`. - * To support silencing the logger must include `LoggerSilence` and `ActiveSupport::LoggerThreadSafeLevel` modules. The `ActiveSupport::Logger` class already includes these modules. + * To support silencing, the logger must include `LoggerSilence` and `ActiveSupport::LoggerThreadSafeLevel` modules. The `ActiveSupport::Logger` class already includes these modules. ```ruby class MyLogger < ::Logger -- cgit v1.2.3 From fe9bd013e2806066e0e43b8b0b4dabab0c8549d1 Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Wed, 13 Apr 2016 00:06:18 +0530 Subject: - Make sure we end sentences - Change from "The Task" to "The Update Task" as referred elsewhere [ci skip] --- guides/source/upgrading_ruby_on_rails.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'guides') diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index 0c1e00100b..6d6e8f79c3 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -22,10 +22,10 @@ When changing Rails versions, it's best to move slowly, one minor version at a t The process should go as follows: -1. Write tests and make sure they pass -2. Move to the latest patch version after your current version -3. Fix tests and deprecated features -4. Move to the latest patch version of the next minor version +1. Write tests and make sure they pass. +2. Move to the latest patch version after your current version. +3. Fix tests and deprecated features. +4. Move to the latest patch version of the next minor version. Repeat this process until you reach your target Rails version. Each time you move versions, you will need to change the Rails version number in the Gemfile (and possibly other gem versions) and run `bundle update`. Then run the Update task mentioned below to update configuration files, then run your tests. @@ -42,7 +42,7 @@ Rails generally stays close to the latest released Ruby version when it's releas TIP: Ruby 1.8.7 p248 and p249 have marshaling bugs that crash Rails. Ruby Enterprise Edition has these fixed since the release of 1.8.7-2010.02. On the 1.9 front, Ruby 1.9.1 is not usable because it outright segfaults, so if you want to use 1.9.x, jump straight to 1.9.3 for smooth sailing. -### The Task +### The Update Task Rails provides the `app:update` task. After updating the Rails version in the Gemfile, run this task. -- cgit v1.2.3 From efb98e138fbbdca65501cc1770398adc6f621ba1 Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Wed, 20 Apr 2016 00:18:25 +0530 Subject: s/determins/determines/ [ci skip] --- guides/source/configuring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 50487a5356..39615051d4 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -480,7 +480,7 @@ encrypted cookies salt value. Defaults to `'signed encrypted cookie'`. * `config.action_view.automatically_disable_submit_tag` determines whether submit_tag should automatically disable on click, this defaults to true. -* `config.action_view.debug_missing_translation` determins whether to wrap the missing translations key in a `` tag or not. This defaults to true. +* `config.action_view.debug_missing_translation` determines whether to wrap the missing translations key in a `` tag or not. This defaults to true. ### Configuring Action Mailer -- cgit v1.2.3 From db3f68f4d733437ade5d0668b981542b2e0873b2 Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Fri, 22 Apr 2016 17:17:54 +0530 Subject: `debug_exception_format` is set to :api by default for API apps only, not for normal apps. [ci skip] --- guides/source/api_app.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/api_app.md b/guides/source/api_app.md index 8dba914923..ea71ee96cc 100644 --- a/guides/source/api_app.md +++ b/guides/source/api_app.md @@ -181,7 +181,7 @@ To render debugging information preserving the response format, use the value `: config.debug_exception_response_format = :api ``` -By default, `config.debug_exception_response_format` is set to `:api`. +By default, `config.debug_exception_response_format` is set to `:api` for API apps. Finally, inside `app/controllers/application_controller.rb`, instead of: -- cgit v1.2.3 From 4d770712595ae1d4937d602dce7ab1220ec6ef7f Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Fri, 22 Apr 2016 17:21:13 +0530 Subject: Mention default values for `debug_exception_response_format` in configuring guide [ci skip] --- guides/source/configuring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 39615051d4..a5fe16ae0a 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -98,7 +98,7 @@ application. Accepts a valid week day symbol (e.g. `:monday`). * `config.exceptions_app` sets the exceptions application invoked by the ShowException middleware when an exception happens. Defaults to `ActionDispatch::PublicExceptions.new(Rails.public_path)`. -* `config.debug_exception_response_format` sets the format used in responses when errors occur in development mode. +* `config.debug_exception_response_format` sets the format used in responses when errors occur in development mode. Defaults to `:api` for API only apps and `:default` for normal apps. * `config.file_watcher` is the class used to detect file updates in the file system when `config.reload_classes_only_on_change` is true. Rails ships with `ActiveSupport::FileUpdateChecker`, the default, and `ActiveSupport::EventedFileUpdateChecker` (this one depends on the [listen](https://github.com/guard/listen) gem). Custom classes must conform to the `ActiveSupport::FileUpdateChecker` API. -- cgit v1.2.3 From 7f9c9d6dcbe83f857639b7ac6dd2f79295fef875 Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Sat, 23 Apr 2016 11:22:43 +0530 Subject: be specific when the debug_exception_response_format to :api [ci skip] --- guides/source/api_app.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/api_app.md b/guides/source/api_app.md index ea71ee96cc..7e6e411c02 100644 --- a/guides/source/api_app.md +++ b/guides/source/api_app.md @@ -181,7 +181,7 @@ To render debugging information preserving the response format, use the value `: config.debug_exception_response_format = :api ``` -By default, `config.debug_exception_response_format` is set to `:api` for API apps. +By default, `config.debug_exception_response_format` is set to `:api`, when `config.api_only` is set to true. Finally, inside `app/controllers/application_controller.rb`, instead of: -- cgit v1.2.3