aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
Diffstat (limited to 'guides')
-rw-r--r--guides/rails_guides/generator.rb2
-rw-r--r--guides/source/6_0_release_notes.md14
-rw-r--r--guides/source/active_record_migrations.md3
-rw-r--r--guides/source/active_record_querying.md2
-rw-r--r--guides/source/active_support_instrumentation.md11
-rw-r--r--guides/source/command_line.md2
-rw-r--r--guides/source/configuring.md8
-rw-r--r--guides/source/debugging_rails_applications.md2
-rw-r--r--guides/source/engines.md1
-rw-r--r--guides/source/testing.md6
10 files changed, 39 insertions, 12 deletions
diff --git a/guides/rails_guides/generator.rb b/guides/rails_guides/generator.rb
index c3b77aa7bb..7d4a15962c 100644
--- a/guides/rails_guides/generator.rb
+++ b/guides/rails_guides/generator.rb
@@ -164,7 +164,7 @@ module RailsGuides
# Generate the special pages like the home.
# Passing a template handler in the template name is deprecated. So pass the file name without the extension.
- result = view.render(layout: layout, formats: [$1], file: $`)
+ result = view.render(layout: layout, formats: [$1.to_sym], file: $`)
else
body = File.read("#{@source_dir}/#{guide}")
result = RailsGuides::Markdown.new(
diff --git a/guides/source/6_0_release_notes.md b/guides/source/6_0_release_notes.md
index 0cf9ca09c7..6c3091153f 100644
--- a/guides/source/6_0_release_notes.md
+++ b/guides/source/6_0_release_notes.md
@@ -138,7 +138,7 @@ Please refer to the [Changelog][railties] for detailed changes.
the generators.
([Pull Request](https://github.com/rails/rails/pull/34021))
-* Add support for multi environment credentials=.
+* Add support for multi environment credentials.
([Pull Request](https://github.com/rails/rails/pull/33521))
* Make `null_store` as default cache store in test environment.
@@ -237,6 +237,18 @@ Please refer to the [Changelog][active-model] for detailed changes.
### Notable changes
+* Add a configuration option to customize format of the `ActiveModel::Errors#full_message`.
+ ([Pull Request](https://github.com/rails/rails/pull/32956))
+
+* Add support for configuring attribute name for `has_secure_password`.
+ ([Pull Request](https://github.com/rails/rails/pull/26764))
+
+* Add `#slice!` method to `ActiveModel::Errors`.
+ ([Pull Request](https://github.com/rails/rails/pull/34489))
+
+* Add `ActiveModel::Errors#of_kind?` to check presence of a specific error.
+ ([Pull Request](https://github.com/rails/rails/pull/34866))
+
Active Support
--------------
diff --git a/guides/source/active_record_migrations.md b/guides/source/active_record_migrations.md
index be0bc495f7..270e4a3bf9 100644
--- a/guides/source/active_record_migrations.md
+++ b/guides/source/active_record_migrations.md
@@ -465,7 +465,6 @@ number of digits after the decimal point.
* `default` Allows to set a default value on the column. Note that if you
are using a dynamic value (such as a date), the default will only be calculated
the first time (i.e. on the date the migration is applied).
-* `index` Adds an index for the column.
* `comment` Adds a comment for the column.
Some adapters may support additional options; see the adapter specific API docs
@@ -948,7 +947,7 @@ If `:ruby` is selected, then the schema is stored in `db/schema.rb`. If you look
at this file you'll find that it looks an awful lot like one very big migration:
```ruby
-ActiveRecord::Schema.define(version: 20080906171750) do
+ActiveRecord::Schema.define(version: 2008_09_06_171750) do
create_table "authors", force: true do |t|
t.string "name"
t.datetime "created_at"
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md
index 71a03e11d9..e40f16e62d 100644
--- a/guides/source/active_record_querying.md
+++ b/guides/source/active_record_querying.md
@@ -59,11 +59,13 @@ To retrieve objects from the database, Active Record provides several finder met
The methods are:
+* `annotate`
* `find`
* `create_with`
* `distinct`
* `eager_load`
* `extending`
+* `extract_associated`
* `from`
* `group`
* `having`
diff --git a/guides/source/active_support_instrumentation.md b/guides/source/active_support_instrumentation.md
index 89e0e3afa8..d7dbc5cea8 100644
--- a/guides/source/active_support_instrumentation.md
+++ b/guides/source/active_support_instrumentation.md
@@ -692,5 +692,16 @@ ActiveSupport::Notifications.subscribe "my.custom.event" do |name, started, fini
end
```
+You also have the option to call instrument without passing a block. This lets you leverage the
+instrumentation infrastructure for other messaging uses.
+
+```ruby
+ActiveSupport::Notifications.instrument "my.custom.event", this: :data
+
+ActiveSupport::Notifications.subscribe "my.custom.event" do |name, started, finished, unique_id, data|
+ puts data.inspect # {:this=>:data}
+end
+```
+
You should follow Rails conventions when defining your own events. The format is: `event.library`.
If your application is sending Tweets, you should create an event named `tweet.twitter`.
diff --git a/guides/source/command_line.md b/guides/source/command_line.md
index 04c8352b90..ddb30a3aec 100644
--- a/guides/source/command_line.md
+++ b/guides/source/command_line.md
@@ -606,7 +606,7 @@ $ rails "task_name[value 1]" # entire argument string should be quoted
$ rails db:nothing
```
-NOTE: If your need to interact with your application models, perform database queries, and so on, your task should depend on the `environment` task, which will load your application code.
+NOTE: If you need to interact with your application models, perform database queries, and so on, your task should depend on the `environment` task, which will load your application code.
The Rails Advanced Command Line
-------------------------------
diff --git a/guides/source/configuring.md b/guides/source/configuring.md
index a61ba5dc9f..86e2dd284e 100644
--- a/guides/source/configuring.md
+++ b/guides/source/configuring.md
@@ -86,6 +86,8 @@ application. Accepts a valid week day symbol (e.g. `:monday`).
end
```
+* `config.disable_sandbox` controls whether or not someone can start a console in sandbox mode. This is helpful to avoid a long running session of sandbox console, that could lead a database server to run out of memory. Defaults to false.
+
* `config.eager_load` when `true`, eager loads all registered `config.eager_load_namespaces`. This includes your application, engines, Rails frameworks, and any other registered namespace.
* `config.eager_load_namespaces` registers namespaces that are eager loaded when `config.eager_load` is `true`. All namespaces in the list must respond to the `eager_load!` method.
@@ -308,7 +310,7 @@ All these configuration options are delegated to the `I18n` library.
### Configuring Active Model
-* `config.active_model.i18n_full_message` is a boolean value which controls whether the `full_message` error format can be overridden at the attribute or model level in the locale files. This is `false` by default.
+* `config.active_model.i18n_customize_full_message` is a boolean value which controls whether the `full_message` error format can be overridden at the attribute or model level in the locale files. This is `false` by default.
### Configuring Active Record
@@ -581,7 +583,7 @@ Defaults to `'signed cookie'`.
The default setting is `true`, which uses the partial at `/admin/articles/_article.erb`. Setting the value to `false` would render `/articles/_article.erb`, which is the same behavior as rendering from a non-namespaced controller such as `ArticlesController`.
* `config.action_view.raise_on_missing_translations` determines whether an
- error should be raised for missing translations.
+ error should be raised for missing translations. This defaults to `false`.
* `config.action_view.automatically_disable_submit_tag` determines whether
`submit_tag` should automatically disable on click, this defaults to `true`.
@@ -725,7 +727,7 @@ There are a few configuration options available in Active Support:
* `ActiveSupport::Deprecation.silence` takes a block in which all deprecation warnings are silenced.
-* `ActiveSupport::Deprecation.silenced` sets whether or not to display deprecation warnings.
+* `ActiveSupport::Deprecation.silenced` sets whether or not to display deprecation warnings. The default is `false`.
### Configuring Active Job
diff --git a/guides/source/debugging_rails_applications.md b/guides/source/debugging_rails_applications.md
index 3a383cbd4d..77513c3a84 100644
--- a/guides/source/debugging_rails_applications.md
+++ b/guides/source/debugging_rails_applications.md
@@ -147,7 +147,7 @@ TIP: The default Rails log level is `debug` in all environments.
### Sending Messages
-To write in the current log use the `logger.(debug|info|warn|error|fatal)` method from within a controller, model, or mailer:
+To write in the current log use the `logger.(debug|info|warn|error|fatal|unknown)` method from within a controller, model, or mailer:
```ruby
logger.debug "Person attributes hash: #{@person.attributes.inspect}"
diff --git a/guides/source/engines.md b/guides/source/engines.md
index a00311bffb..0b17137270 100644
--- a/guides/source/engines.md
+++ b/guides/source/engines.md
@@ -1518,6 +1518,7 @@ To hook into the initialization process of one of the following classes use the
| `ActiveJob::Base` | `active_job` |
| `ActiveJob::TestCase` | `active_job_test_case` |
| `ActiveRecord::Base` | `active_record` |
+| `ActiveStorage::Attachment` | `active_storage_attachment` |
| `ActiveStorage::Blob` | `active_storage_blob` |
| `ActiveSupport::TestCase` | `active_support_test_case` |
| `i18n` | `i18n` |
diff --git a/guides/source/testing.md b/guides/source/testing.md
index 93372b5c26..1fad02812b 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -1404,7 +1404,7 @@ If you find your helpers are cluttering `test_helper.rb`, you can extract them i
```ruby
# lib/test/multiple_assertions.rb
module MultipleAssertions
- def assert_multiple_of_fourty_two(number)
+ def assert_multiple_of_forty_two(number)
assert (number % 42 == 0), 'expected #{number} to be a multiple of 42'
end
end
@@ -1419,8 +1419,8 @@ require 'test/multiple_assertions'
class NumberTest < ActiveSupport::TestCase
include MultipleAssertions
- test '420 is a multiple of fourty two' do
- assert_multiple_of_fourty_two 420
+ test '420 is a multiple of forty two' do
+ assert_multiple_of_forty_two 420
end
end
```