aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
Diffstat (limited to 'guides')
-rw-r--r--guides/source/5_0_release_notes.md9
-rw-r--r--guides/source/action_cable_overview.md9
-rw-r--r--guides/source/active_support_core_extensions.md3
-rw-r--r--guides/source/api_documentation_guidelines.md2
-rw-r--r--guides/source/configuring.md2
-rw-r--r--guides/source/getting_started.md5
-rw-r--r--guides/source/testing.md18
7 files changed, 30 insertions, 18 deletions
diff --git a/guides/source/5_0_release_notes.md b/guides/source/5_0_release_notes.md
index 8bd2074e82..1eb6f87fd3 100644
--- a/guides/source/5_0_release_notes.md
+++ b/guides/source/5_0_release_notes.md
@@ -49,7 +49,7 @@ client-side JavaScript framework and a server-side Ruby framework. You have
access to your full domain model written with Active Record or your ORM of
choice.
-See the [Active Cable Overview](action_cable_overview.html) guide for more
+See the [Action Cable Overview](action_cable_overview.html) guide for more
information.
### Rails API
@@ -967,6 +967,13 @@ Please refer to the [Changelog][active-support] for detailed changes.
* `ActiveSupport::Duration` now supports ISO8601 formatting and parsing.
([Pull Request](https://github.com/rails/rails/pull/16917))
+* `ActiveSupport::JSON.decode` now supports parsing ISO8601 local times when
+ `parse_json_times` is enabled.
+ ([Pull Request](https://github.com/rails/rails/pull/23011))
+
+* `ActiveSupport::JSON.decode` now return `Date` objects for date strings.
+ ([Pull Request](https://github.com/rails/rails/pull/23011))
+
* Added ability to `TaggedLogging` to allow loggers to be instantiated multiple
times so that they don't share tags with each other.
([Pull Request](https://github.com/rails/rails/pull/9065))
diff --git a/guides/source/action_cable_overview.md b/guides/source/action_cable_overview.md
index 16aa9438a2..2308befd12 100644
--- a/guides/source/action_cable_overview.md
+++ b/guides/source/action_cable_overview.md
@@ -6,8 +6,10 @@ incorporate real-time features into your Rails application.
After reading this guide, you will know:
+* What Action Cable is and its integration on backend and frontend
* How to setup Action Cable
* How to setup channels
+* Deployment and Architecture setup for running Action Cable
Introduction
------------
@@ -568,12 +570,13 @@ environment configuration files.
### Other Configurations
-The other common option to configure is the log tags applied to the
-per-connection logger. Here's close to what we're using in Basecamp:
+The other common option to configure, is the log tags applied to the
+per-connection logger. Here's an example that uses
+the user account id if available, else "no-account" while tagging:
```ruby
config.action_cable.log_tags = [
- -> request { request.env['bc.account_id'] || "no-account" },
+ -> request { request.env['user_account_id'] || "no-account" },
:action_cable,
-> request { request.uuid }
]
diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md
index 565c87c4b5..e0b6f2f820 100644
--- a/guides/source/active_support_core_extensions.md
+++ b/guides/source/active_support_core_extensions.md
@@ -954,7 +954,8 @@ class A
class_attribute :x, instance_reader: false
end
-A.new.x = 1 # NoMethodError
+A.new.x = 1
+A.new.x # NoMethodError
```
For convenience `class_attribute` also defines an instance predicate which is the double negation of what the instance reader returns. In the examples above it would be called `x?`.
diff --git a/guides/source/api_documentation_guidelines.md b/guides/source/api_documentation_guidelines.md
index 5b34330936..34b9c0d2ca 100644
--- a/guides/source/api_documentation_guidelines.md
+++ b/guides/source/api_documentation_guidelines.md
@@ -20,7 +20,7 @@ The [Rails API documentation](http://api.rubyonrails.org) is generated with
in the rails root directory, run `bundle install` and execute:
```bash
- ./bin/rails rdoc
+ bundle exec rake rdoc
```
Resulting HTML files can be found in the ./doc/rdoc directory.
diff --git a/guides/source/configuring.md b/guides/source/configuring.md
index b3d3b2c681..f34b6473b2 100644
--- a/guides/source/configuring.md
+++ b/guides/source/configuring.md
@@ -94,6 +94,8 @@ application. Accepts a valid week day symbol (e.g. `:monday`).
* `config.eager_load_paths` accepts an array of paths from which Rails will eager load on boot if cache classes is enabled. Defaults to every folder in the `app` directory of the application.
+* `config.enable_dependency_loading`: when true, enables autoload loading, even if the application is eager loaded and `config.cache_classes` is set as true. Defaults to false.
+
* `config.encoding` sets up the application-wide encoding. Defaults to UTF-8.
* `config.exceptions_app` sets the exceptions application invoked by the ShowException middleware when an exception happens. Defaults to `ActionDispatch::PublicExceptions.new(Rails.public_path)`.
diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md
index 65fdd7ca0d..e0832a32a6 100644
--- a/guides/source/getting_started.md
+++ b/guides/source/getting_started.md
@@ -299,9 +299,6 @@ Rails.application.routes.draw do
get 'welcome/index'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
-
- # Serve websocket cable requests in-process
- # mount ActionCable.server => '/cable'
end
```
@@ -318,8 +315,6 @@ Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
- # Serve websocket cable requests in-process
- # mount ActionCable.server => '/cable'
root 'welcome#index'
end
```
diff --git a/guides/source/testing.md b/guides/source/testing.md
index 050bdda9e3..d4a826cee5 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -695,7 +695,7 @@ end
In the `test_should_get_index` test, Rails simulates a request on the action called `index`, making sure the request was successful
and also ensuring that the right response body has been generated.
-The `get` method kicks off the web request and populates the results into the `@response`. It accepts 4 arguments:
+The `get` method kicks off the web request and populates the results into the `@response`. It can accept up to 6 arguments:
* The action of the controller you are requesting.
This can be in the form of a string or a route (i.e. `articles_url`).
@@ -703,22 +703,26 @@ The `get` method kicks off the web request and populates the results into the `@
* `params`: option with a hash of request parameters to pass into the action
(e.g. query string parameters or article variables).
-* `session`: option with a hash of session variables to pass along with the request.
+* `headers`: for setting the headers that will be passed with the request.
-* `flash`: option with a hash of flash values.
+* `env`: for customizing the request environment as needed.
+
+* `xhr`: whether the request is Ajax request or not. Can be set to true for marking the request as Ajax.
+
+* `as`: for encoding the request with different content type. Supports `:json` by default.
All of these keyword arguments are optional.
-Example: Calling the `:show` action, passing an `id` of 12 as the `params` and setting a `user_id` of 5 in the session:
+Example: Calling the `:show` action, passing an `id` of 12 as the `params` and setting `HTTP_REFERER` header:
```ruby
-get(:show, params: { id: 12 }, session: { user_id: 5 })
+get :show, params: { id: 12 }, headers: { "HTTP_REFERER" => "http://example.com/home" }
```
-Another example: Calling the `:view` action, passing an `id` of 12 as the `params`, this time with no session, but with a flash message.
+Another example: Calling the `:update` action, passing an `id` of 12 as the `params` as an Ajax request.
```ruby
-get(view_url, params: { id: 12 }, flash: { message: 'booya!' })
+patch update_url, params: { id: 12 }, xhr: true
```
NOTE: If you try running `test_should_create_article` test from `articles_controller_test.rb` it will fail on account of the newly added model level validation and rightly so.