From a20b440bd22c1ca3a53962551724ea621813bdf7 Mon Sep 17 00:00:00 2001 From: Toshimaru Date: Sun, 28 Sep 2025 05:04:57 +0900 Subject: [PATCH 1/2] build: Docs for Rails 7.1 --- src/7.1/classes/AbstractController/Base.html | 6 +- .../AbstractController/Caching/Fragments.html | 8 +- .../classes/AbstractController/Rendering.html | 2 +- src/7.1/classes/ActionCable/Channel/Base.html | 2 +- .../ActionCable/Channel/ChannelStub.html | 2 +- .../Channel/Naming/ClassMethods.html | 2 +- .../classes/ActionCable/Channel/TestCase.html | 6 +- .../RemoteConnections/RemoteConnection.html | 2 +- .../ActionCable/SubscriptionAdapter/Test.html | 2 +- src/7.1/classes/ActionController/API.html | 6 +- src/7.1/classes/ActionController/Base.html | 2 +- .../ActionController/ConditionalGet.html | 28 +-- .../ActionController/DataStreaming.html | 6 +- src/7.1/classes/ActionController/Helpers.html | 2 +- .../HttpAuthentication/Token.html | 6 +- src/7.1/classes/ActionController/Live.html | 2 +- src/7.1/classes/ActionController/Metal.html | 4 +- .../ActionController/MimeResponds.html | 2 +- .../classes/ActionController/Parameters.html | 60 ++--- .../ActionController/ParamsWrapper.html | 6 +- .../ParamsWrapper/Options/ClassMethods.html | 2 +- .../classes/ActionController/Redirecting.html | 12 +- .../classes/ActionController/Renderer.html | 2 +- .../classes/ActionController/Renderers.html | 4 +- .../Renderers/ClassMethods.html | 4 +- .../classes/ActionController/Rendering.html | 22 +- .../RequestForgeryProtection.html | 4 +- .../classes/ActionController/TestCase.html | 6 +- .../TestCase/Behavior/ClassMethods.html | 2 +- .../Assertions/RoutingAssertions.html | 4 +- src/7.1/classes/ActionDispatch/Cookies.html | 2 +- .../ActionDispatch/Http/Cache/Response.html | 2 +- .../ActionDispatch/Http/FilterParameters.html | 2 +- .../ActionDispatch/Integration/Session.html | 2 +- .../ActionDispatch/IntegrationTest.html | 2 +- src/7.1/classes/ActionDispatch/RemoteIp.html | 4 +- src/7.1/classes/ActionDispatch/Request.html | 14 +- .../ActionDispatch/Routing/Mapper/Base.html | 34 +-- .../Routing/Mapper/CustomUrls.html | 2 +- .../Routing/Mapper/Resources.html | 20 +- .../Routing/Mapper/Scoping.html | 4 +- .../Routing/PolymorphicRoutes.html | 6 +- .../ActionDispatch/Routing/UrlFor.html | 10 +- .../ActionDispatch/Session/CacheStore.html | 2 +- .../ActionDispatch/ShowExceptions.html | 2 +- .../ActionDispatch/SystemTestCase.html | 6 +- .../TestHelpers/ScreenshotHelper.html | 10 +- src/7.1/classes/ActionMailbox.html | 2 +- src/7.1/classes/ActionMailbox/Base.html | 2 +- .../classes/ActionMailbox/InboundEmail.html | 8 +- .../InboundEmail/Incineratable.html | 2 +- .../Incineratable/Incineration.html | 2 +- .../ActionMailbox/InboundEmail/MessageId.html | 2 +- .../ActionMailbox/InboundEmail/Routable.html | 8 +- .../ActionMailbox/IncinerationJob.html | 4 +- src/7.1/classes/ActionMailer/Base.html | 26 +- src/7.1/classes/ActionMailer/FormBuilder.html | 2 +- .../classes/ActionMailer/MessageDelivery.html | 6 +- src/7.1/classes/ActionText/Attachable.html | 2 +- src/7.1/classes/ActionText/Attribute.html | 2 +- src/7.1/classes/ActionText/Content.html | 4 +- src/7.1/classes/ActionText/FixtureSet.html | 2 +- .../ActionView/Helpers/AssetTagHelper.html | 4 +- .../ActionView/Helpers/AssetUrlHelper.html | 24 +- .../ActionView/Helpers/AtomFeedHelper.html | 2 +- .../ActionView/Helpers/CacheHelper.html | 2 +- .../ActionView/Helpers/CaptureHelper.html | 18 +- .../ActionView/Helpers/DateHelper.html | 16 +- .../ActionView/Helpers/FormBuilder.html | 22 +- .../ActionView/Helpers/FormHelper.html | 50 ++-- .../ActionView/Helpers/FormOptionsHelper.html | 18 +- .../ActionView/Helpers/FormTagHelper.html | 4 +- .../ActionView/Helpers/SanitizeHelper.html | 6 +- .../ActionView/Helpers/TextHelper.html | 20 +- .../classes/ActionView/Helpers/UrlHelper.html | 18 +- .../ActionView/Layouts/ClassMethods.html | 14 +- src/7.1/classes/ActionView/Renderer.html | 2 +- src/7.1/classes/ActionView/RoutingUrlFor.html | 4 +- src/7.1/classes/ActionView/Template.html | 8 +- src/7.1/classes/ActionView/TestCase.html | 2 +- .../classes/ActionView/TestCase/Behavior.html | 2 +- .../TestCase/Behavior/ClassMethods.html | 8 +- .../ActiveJob/Enqueuing/ClassMethods.html | 2 +- src/7.1/classes/ActiveJob/Execution.html | 2 +- .../QueueAdapters/QueueClassicAdapter.html | 2 +- src/7.1/classes/ActiveJob/TestHelper.html | 4 +- src/7.1/classes/ActiveModel.html | 2 +- src/7.1/classes/ActiveModel/API.html | 4 +- .../classes/ActiveModel/AttributeMethods.html | 4 +- .../AttributeMethods/ClassMethods.html | 8 +- src/7.1/classes/ActiveModel/Callbacks.html | 10 +- src/7.1/classes/ActiveModel/Dirty.html | 8 +- .../classes/ActiveModel/EachValidator.html | 4 +- src/7.1/classes/ActiveModel/Errors.html | 10 +- src/7.1/classes/ActiveModel/Lint/Tests.html | 2 +- src/7.1/classes/ActiveModel/Model.html | 2 +- src/7.1/classes/ActiveModel/Name.html | 4 +- src/7.1/classes/ActiveModel/Naming.html | 2 +- .../SecurePassword/ClassMethods.html | 2 +- .../classes/ActiveModel/Serialization.html | 2 +- .../classes/ActiveModel/Serializers/JSON.html | 2 +- src/7.1/classes/ActiveModel/Translation.html | 4 +- src/7.1/classes/ActiveModel/Type/Boolean.html | 2 +- src/7.1/classes/ActiveModel/Type/Value.html | 2 +- src/7.1/classes/ActiveModel/Validations.html | 8 +- .../ActiveModel/Validations/Callbacks.html | 2 +- .../ActiveModel/Validations/ClassMethods.html | 6 +- .../Validations/HelperMethods.html | 2 +- .../Associations/ClassMethods.html | 226 +++++++++--------- .../Associations/CollectionProxy.html | 6 +- .../ActiveRecord/AttributeMethods.html | 2 +- .../ActiveRecord/AttributeMethods/Dirty.html | 8 +- .../Serialization/ClassMethods.html | 8 +- .../ActiveRecord/Attributes/ClassMethods.html | 2 +- .../ConnectionAdapters/AbstractAdapter.html | 2 +- .../AbstractMysqlAdapter.html | 6 +- .../ConnectionAdapters/ConnectionPool.html | 6 +- .../DatabaseStatements.html | 2 +- .../PostgreSQL/SchemaStatements.html | 10 +- .../ConnectionAdapters/PostgreSQLAdapter.html | 2 +- .../ConnectionAdapters/SchemaStatements.html | 64 ++--- .../ActiveRecord/ConnectionHandling.html | 12 +- src/7.1/classes/ActiveRecord/Core.html | 2 +- .../ActiveRecord/Core/ClassMethods.html | 4 +- .../ActiveRecord/DatabaseConfigurations.html | 6 +- .../DatabaseConfigurations/HashConfig.html | 8 +- .../DatabaseConfigurations/UrlConfig.html | 4 +- .../classes/ActiveRecord/DelegatedType.html | 6 +- .../ActiveRecord/Encryption/Cipher.html | 10 +- .../Encryption/Cipher/Aes256Gcm.html | 2 +- .../ActiveRecord/Encryption/Contexts.html | 2 +- .../Encryption/EncryptableRecord.html | 2 +- .../Encryption/EncryptedAttributeType.html | 4 +- .../ActiveRecord/Encryption/Encryptor.html | 8 +- .../classes/ActiveRecord/Encryption/Key.html | 2 +- .../ActiveRecord/Encryption/KeyGenerator.html | 6 +- .../ActiveRecord/Encryption/KeyProvider.html | 2 +- .../ActiveRecord/Encryption/Properties.html | 2 +- .../Encryption/ReadOnlyNullEncryptor.html | 2 +- src/7.1/classes/ActiveRecord/Inheritance.html | 2 +- .../Inheritance/ClassMethods.html | 6 +- src/7.1/classes/ActiveRecord/Integration.html | 4 +- .../Integration/ClassMethods.html | 2 +- .../ActiveRecord/IrreversibleMigration.html | 4 +- .../ActiveRecord/Locking/Optimistic.html | 4 +- .../Locking/Optimistic/ClassMethods.html | 2 +- .../ActiveRecord/Locking/Pessimistic.html | 8 +- src/7.1/classes/ActiveRecord/Migration.html | 6 +- .../Migration/CommandRecorder.html | 4 +- .../ActiveRecord/MigrationContext.html | 2 +- src/7.1/classes/ActiveRecord/ModelSchema.html | 4 +- .../NestedAttributes/ClassMethods.html | 8 +- src/7.1/classes/ActiveRecord/Persistence.html | 2 +- .../Persistence/ClassMethods.html | 32 +-- src/7.1/classes/ActiveRecord/Promise.html | 4 +- src/7.1/classes/ActiveRecord/QueryLogs.html | 2 +- .../classes/ActiveRecord/QueryMethods.html | 6 +- .../ActiveRecord/QueryMethods/WhereChain.html | 2 +- src/7.1/classes/ActiveRecord/Querying.html | 4 +- .../Reflection/MacroReflection.html | 2 +- src/7.1/classes/ActiveRecord/Relation.html | 6 +- .../Scoping/Default/ClassMethods.html | 2 +- .../SecurePassword/ClassMethods.html | 2 +- .../SecureToken/ClassMethods.html | 6 +- src/7.1/classes/ActiveRecord/SignedId.html | 2 +- .../ActiveRecord/SignedId/ClassMethods.html | 4 +- .../ActiveRecord/Tasks/DatabaseTasks.html | 10 +- src/7.1/classes/ActiveRecord/Timestamp.html | 2 +- .../Validations/ClassMethods.html | 2 +- src/7.1/classes/ActiveStorage.html | 4 +- .../classes/ActiveStorage/Attached/Model.html | 12 +- src/7.1/classes/ActiveStorage/Attachment.html | 6 +- src/7.1/classes/ActiveStorage/Blob.html | 10 +- .../ActiveStorage/Blob/Analyzable.html | 2 +- src/7.1/classes/ActiveStorage/Preview.html | 4 +- src/7.1/classes/ActiveStorage/Service.html | 2 +- src/7.1/classes/ActiveStorage/Variation.html | 2 +- .../ActiveSupport/ActionableError.html | 2 +- .../classes/ActiveSupport/ArrayInquirer.html | 2 +- .../ActiveSupport/Cache/FileStore.html | 2 +- .../ActiveSupport/Cache/MemCacheStore.html | 8 +- .../ActiveSupport/Cache/MemoryStore.html | 4 +- .../ActiveSupport/Cache/RedisCacheStore.html | 4 +- .../classes/ActiveSupport/Cache/Store.html | 10 +- .../ActiveSupport/Cache/WriteOptions.html | 6 +- src/7.1/classes/ActiveSupport/Callbacks.html | 2 +- .../ActiveSupport/Callbacks/ClassMethods.html | 6 +- src/7.1/classes/ActiveSupport/Concern.html | 4 +- .../ActiveSupport/Concurrency/ShareLock.html | 2 +- .../Dependencies/RequireDependency.html | 2 +- .../ActiveSupport/Deprecation/Behavior.html | 28 +-- .../DeprecatedConstantAccessor.html | 2 +- .../ActiveSupport/DescendantsTracker.html | 2 +- src/7.1/classes/ActiveSupport/Duration.html | 2 +- .../ActiveSupport/EncryptedConfiguration.html | 2 +- .../classes/ActiveSupport/EncryptedFile.html | 6 +- .../classes/ActiveSupport/ErrorReporter.html | 2 +- .../ActiveSupport/ExecutionWrapper.html | 2 +- .../ActiveSupport/FileUpdateChecker.html | 6 +- .../HashWithIndifferentAccess.html | 8 +- .../ActiveSupport/InheritableOptions.html | 2 +- .../classes/ActiveSupport/LazyLoadHooks.html | 6 +- .../classes/ActiveSupport/LogSubscriber.html | 6 +- .../ActiveSupport/MessageEncryptor.html | 24 +- .../classes/ActiveSupport/MessagePack.html | 2 +- .../ActiveSupport/MessageVerifier.html | 34 +-- .../ActiveSupport/Multibyte/Chars.html | 2 +- .../classes/ActiveSupport/Notifications.html | 4 +- .../Notifications/Fanout/Handle.html | 4 +- .../Notifications/Instrumenter.html | 2 +- .../classes/ActiveSupport/NumberHelper.html | 98 ++++---- .../ActiveSupport/NumericWithFormat.html | 2 +- .../classes/ActiveSupport/OrderedOptions.html | 6 +- .../ActiveSupport/ParameterFilter.html | 6 +- .../ActiveSupport/RangeWithFormat.html | 2 +- .../ActiveSupport/Rescuable/ClassMethods.html | 4 +- .../classes/ActiveSupport/StringInquirer.html | 2 +- src/7.1/classes/ActiveSupport/Subscriber.html | 2 +- .../ActiveSupport/Testing/Deprecation.html | 2 +- .../Testing/ErrorReporterAssertions.html | 4 +- .../ActiveSupport/Testing/FileFixtures.html | 4 +- .../Testing/SetupAndTeardown.html | 2 +- .../ActiveSupport/Testing/TimeHelpers.html | 6 +- .../classes/ActiveSupport/TimeWithZone.html | 18 +- src/7.1/classes/ActiveSupport/TimeZone.html | 2 +- src/7.1/classes/Array.html | 14 +- src/7.1/classes/Class.html | 2 +- src/7.1/classes/Date.html | 8 +- src/7.1/classes/DateAndTime/Calculations.html | 26 +- src/7.1/classes/DateAndTime/Zones.html | 6 +- src/7.1/classes/DateTime.html | 10 +- src/7.1/classes/ERB/Util.html | 2 +- src/7.1/classes/Enumerable.html | 8 +- src/7.1/classes/Hash.html | 14 +- src/7.1/classes/Module.html | 12 +- src/7.1/classes/Object.html | 24 +- src/7.1/classes/Rails/Application.html | 12 +- .../Rails/Application/Configuration.html | 4 +- .../Configuration/MiddlewareStackProxy.html | 6 +- src/7.1/classes/Rails/Engine.html | 22 +- src/7.1/classes/Rails/Generators/Actions.html | 26 +- src/7.1/classes/Rails/Paths/Root.html | 2 +- src/7.1/classes/Rails/Railtie.html | 6 +- .../Rails/SourceAnnotationExtractor.html | 2 +- src/7.1/classes/String.html | 6 +- src/7.1/classes/Time.html | 22 +- src/7.1/files/activemodel/README_rdoc.html | 2 +- .../app/models/active_storage/preview_rb.html | 2 +- .../attribute_accessors_per_thread_rb.html | 2 +- src/7.1/files/railties/RDOC_MAIN_md.html | 4 +- src/7.1/index.html | 4 +- 251 files changed, 993 insertions(+), 993 deletions(-) diff --git a/src/7.1/classes/AbstractController/Base.html b/src/7.1/classes/AbstractController/Base.html index 5c743761c9..dc728d2a06 100644 --- a/src/7.1/classes/AbstractController/Base.html +++ b/src/7.1/classes/AbstractController/Base.html @@ -300,7 +300,7 @@

Returns

@@ -415,7 +415,7 @@

-

Returns true if the given controller is capable of rendering a path. A subclass of AbstractController::Base may return false. An Email controller for example does not support paths, only full URLs.

+

Returns true if the given controller is capable of rendering a path. A subclass of AbstractController::Base may return false. An Email controller for example does not support paths, only full URLs.

@@ -529,7 +529,7 @@

Parameters

diff --git a/src/7.1/classes/AbstractController/Caching/Fragments.html b/src/7.1/classes/AbstractController/Caching/Fragments.html index d6ae7dc0c1..228e431ec1 100644 --- a/src/7.1/classes/AbstractController/Caching/Fragments.html +++ b/src/7.1/classes/AbstractController/Caching/Fragments.html @@ -108,7 +108,7 @@

-

Given a key (as described in expire_fragment), returns a key array suitable for use in reading, writing, or expiring a cached fragment. All keys begin with :views, followed by ENV["RAILS_CACHE_ID"] or ENV["RAILS_APP_VERSION"] if set, followed by any controller-wide key prefix values, ending with the specified key value.

+

Given a key (as described in expire_fragment), returns a key array suitable for use in reading, writing, or expiring a cached fragment. All keys begin with :views, followed by ENV["RAILS_CACHE_ID"] or ENV["RAILS_APP_VERSION"] if set, followed by any controller-wide key prefix values, ending with the specified key value.

@@ -204,7 +204,7 @@

-

Check if a cached fragment from the location signified by key exists (see expire_fragment for acceptable formats).

+

Check if a cached fragment from the location signified by key exists (see expire_fragment for acceptable formats).

@@ -244,7 +244,7 @@

-

Reads a cached fragment from the location signified by key (see expire_fragment for acceptable formats).

+

Reads a cached fragment from the location signified by key (see expire_fragment for acceptable formats).

@@ -285,7 +285,7 @@

-

Writes content to the location signified by key (see expire_fragment for acceptable formats).

+

Writes content to the location signified by key (see expire_fragment for acceptable formats).

diff --git a/src/7.1/classes/AbstractController/Rendering.html b/src/7.1/classes/AbstractController/Rendering.html index 28d9d4f71f..eb402fae95 100644 --- a/src/7.1/classes/AbstractController/Rendering.html +++ b/src/7.1/classes/AbstractController/Rendering.html @@ -123,7 +123,7 @@

Normalizes arguments and options, and then delegates to render_to_body and sticks the result in self.response_body.

-

Supported options depend on the underlying render_to_body implementation.

+

Supported options depend on the underlying render_to_body implementation.

diff --git a/src/7.1/classes/ActionCable/Channel/Base.html b/src/7.1/classes/ActionCable/Channel/Base.html index 5a6247a7ea..d1a0c197e5 100644 --- a/src/7.1/classes/ActionCable/Channel/Base.html +++ b/src/7.1/classes/ActionCable/Channel/Base.html @@ -82,7 +82,7 @@

Action process end -

In this example, the subscribed and unsubscribed methods are not callable methods, as they were already declared in ActionCable::Channel::Base, but #appear and #away are. #generate_connection_token is also not callable, since it’s a private method. You’ll see that appear accepts a data parameter, which it then uses as part of its model call. #away does not, since it’s simply a trigger action.

+

In this example, the subscribed and unsubscribed methods are not callable methods, as they were already declared in ActionCable::Channel::Base, but appear and away are. generate_connection_token is also not callable, since it’s a private method. You’ll see that appear accepts a data parameter, which it then uses as part of its model call. away does not, since it’s simply a trigger action.

Also note that in this example, current_user is available because it was marked as an identifying attribute on the connection. All such identifiers will automatically create a delegation method of the same name on the channel instance.

diff --git a/src/7.1/classes/ActionCable/Channel/ChannelStub.html b/src/7.1/classes/ActionCable/Channel/ChannelStub.html index 7f15663b47..3eb0e00221 100644 --- a/src/7.1/classes/ActionCable/Channel/ChannelStub.html +++ b/src/7.1/classes/ActionCable/Channel/ChannelStub.html @@ -25,7 +25,7 @@

Action Cable Channel Stub

-

Stub stream_from to track streams for the channel. Add public aliases for subscription_confirmation_sent? and subscription_rejected?.

+

Stub stream_from to track streams for the channel. Add public aliases for subscription_confirmation_sent? and subscription_rejected?.

diff --git a/src/7.1/classes/ActionCable/Channel/Naming/ClassMethods.html b/src/7.1/classes/ActionCable/Channel/Naming/ClassMethods.html index cbec8e07c3..cc8db42aa1 100644 --- a/src/7.1/classes/ActionCable/Channel/Naming/ClassMethods.html +++ b/src/7.1/classes/ActionCable/Channel/Naming/ClassMethods.html @@ -66,7 +66,7 @@

-

Returns the name of the channel, underscored, without the Channel ending. If the channel is in a namespace, then the namespaces are represented by single colon separators in the channel name.

+

Returns the name of the channel, underscored, without the Channel ending. If the channel is in a namespace, then the namespaces are represented by single colon separators in the channel name.

ChatChannel.channel_name # => 'chat'
 Chats::AppearancesChannel.channel_name # => 'chats:appearances'
diff --git a/src/7.1/classes/ActionCable/Channel/TestCase.html b/src/7.1/classes/ActionCable/Channel/TestCase.html
index 40140b8cf4..c0b76fcb42 100644
--- a/src/7.1/classes/ActionCable/Channel/TestCase.html
+++ b/src/7.1/classes/ActionCable/Channel/TestCase.html
@@ -88,13 +88,13 @@ 

Basic example<

Special methods

ActionCable::Channel::TestCase will also automatically provide the following instance methods for use in the tests:

-
connection +
connection

An ActionCable::Channel::ConnectionStub, representing the current HTTP connection.

-
subscription +
subscription

An instance of the current channel, created when you call subscribe.

-
transmissions +
transmissions

A list of all messages that have been transmitted into the channel.

diff --git a/src/7.1/classes/ActionCable/RemoteConnections/RemoteConnection.html b/src/7.1/classes/ActionCable/RemoteConnections/RemoteConnection.html index 5f03631149..1e77156101 100644 --- a/src/7.1/classes/ActionCable/RemoteConnections/RemoteConnection.html +++ b/src/7.1/classes/ActionCable/RemoteConnections/RemoteConnection.html @@ -31,7 +31,7 @@

Action Cable Remote Connection

-

Represents a single remote connection found via ActionCable.server.remote_connections.where(*). Exists solely for the purpose of calling disconnect on that connection.

+

Represents a single remote connection found via ActionCable.server.remote_connections.where(*). Exists solely for the purpose of calling disconnect on that connection.

diff --git a/src/7.1/classes/ActionCable/SubscriptionAdapter/Test.html b/src/7.1/classes/ActionCable/SubscriptionAdapter/Test.html index da2e66a74f..c955490d4e 100644 --- a/src/7.1/classes/ActionCable/SubscriptionAdapter/Test.html +++ b/src/7.1/classes/ActionCable/SubscriptionAdapter/Test.html @@ -35,7 +35,7 @@

Test adapter extends the ActionCable::SubscriptionAdapter::Async adapter, so it could be used in system tests too.

diff --git a/src/7.1/classes/ActionController/API.html b/src/7.1/classes/ActionController/API.html index c1d7002bda..8571042c69 100644 --- a/src/7.1/classes/ActionController/API.html +++ b/src/7.1/classes/ActionController/API.html @@ -35,7 +35,7 @@

Action Controll

An API Controller is different from a normal controller in the sense that by default it doesn’t include a number of features that are usually required by browser access only: layouts and templates rendering, flash, assets, and so on. This makes the entire controller stack thinner, suitable for API applications. It doesn’t mean you won’t have such features if you need them: they’re all available for you to include in your application, they’re just not part of the default API controller stack.

-

Normally, ApplicationController is the only controller that inherits from ActionController::API. All other controllers in turn inherit from ApplicationController.

+

Normally, ApplicationController is the only controller that inherits from ActionController::API. All other controllers in turn inherit from ApplicationController.

A sample controller could look like this:

@@ -71,7 +71,7 @@

Redirects

Adding New Behavior

-

In some scenarios you may want to add back some functionality provided by ActionController::Base that is not present by default in ActionController::API, for instance MimeResponds. This module gives you the respond_to method. Adding it is quite simple, you just need to include the module in a specific controller or in ApplicationController in case you want it available in your entire application:

+

In some scenarios you may want to add back some functionality provided by ActionController::Base that is not present by default in ActionController::API, for instance MimeResponds. This module gives you the respond_to method. Adding it is quite simple, you just need to include the module in a specific controller or in ApplicationController in case you want it available in your entire application:

class ApplicationController < ActionController::API
   include ActionController::MimeResponds
@@ -89,7 +89,7 @@ 

Adding New Behavi end

-

Make sure to check the modules included in ActionController::Base if you want to use any other functionality that is not provided by ActionController::API out of the box.

+

Make sure to check the modules included in ActionController::Base if you want to use any other functionality that is not provided by ActionController::API out of the box.

diff --git a/src/7.1/classes/ActionController/Base.html b/src/7.1/classes/ActionController/Base.html index 4331e773b6..899127dbe9 100644 --- a/src/7.1/classes/ActionController/Base.html +++ b/src/7.1/classes/ActionController/Base.html @@ -33,7 +33,7 @@

Action Contro

Action Controllers are the core of a web request in Rails. They are made up of one or more actions that are executed on request and then either it renders a template or redirects to another action. An action is defined as a public method on the controller, which will automatically be made accessible to the web-server through Rails Routes.

-

By default, only the ApplicationController in a Rails application inherits from ActionController::Base. All other controllers inherit from ApplicationController. This gives you one class to configure things such as request forgery protection and filtering of sensitive request parameters.

+

By default, only the ApplicationController in a Rails application inherits from ActionController::Base. All other controllers inherit from ApplicationController. This gives you one class to configure things such as request forgery protection and filtering of sensitive request parameters.

A sample controller could look like this:

diff --git a/src/7.1/classes/ActionController/ConditionalGet.html b/src/7.1/classes/ActionController/ConditionalGet.html index e2c8415d59..ee31ee50cd 100644 --- a/src/7.1/classes/ActionController/ConditionalGet.html +++ b/src/7.1/classes/ActionController/ConditionalGet.html @@ -113,21 +113,21 @@

-

Sets the Cache-Control header, overwriting existing directives. This method will also ensure an HTTP Date header for client compatibility.

+

Sets the Cache-Control header, overwriting existing directives. This method will also ensure an HTTP Date header for client compatibility.

Defaults to issuing the private directive, so that intermediate caches must not cache the response.

Options

-
:public +
:public

If true, replaces the default private directive with the public directive.

-
:must_revalidate +
:must_revalidate

If true, adds the must-revalidate directive.

-
:stale_while_revalidate +
:stale_while_revalidate

Sets the value of the stale-while-revalidate directive.

-
:stale_if_error +
:stale_if_error

Sets the value of the stale-if-error directive.

@@ -237,29 +237,29 @@

Sets the etag, last_modified, or both on the response, and renders a 304 Not Modified response if the request is already fresh.

Options

-
:etag +
:etag

Sets a “weak” ETag validator on the response. See the :weak_etag option.

-
:weak_etag +
:weak_etag

Sets a “weak” ETag validator on the response. Requests that specify an If-None-Match header may receive a 304 Not Modified response if the ETag matches exactly.

-

A weak ETag indicates semantic equivalence, not byte-for-byte equality, so they’re good for caching HTML pages in browser caches. They can’t be used for responses that must be byte-identical, like serving Range requests within a PDF file.

-
:strong_etag +

A weak ETag indicates semantic equivalence, not byte-for-byte equality, so they’re good for caching HTML pages in browser caches. They can’t be used for responses that must be byte-identical, like serving Range requests within a PDF file.

+
:strong_etag

Sets a “strong” ETag validator on the response. Requests that specify an If-None-Match header may receive a 304 Not Modified response if the ETag matches exactly.

-

A strong ETag implies exact equality – the response must match byte for byte. This is necessary for serving Range requests within a large video or PDF file, for example, or for compatibility with some CDNs that don’t support weak ETags.

-
:last_modified +

A strong ETag implies exact equality – the response must match byte for byte. This is necessary for serving Range requests within a large video or PDF file, for example, or for compatibility with some CDNs that don’t support weak ETags.

+
:last_modified

Sets a “weak” last-update validator on the response. Subsequent requests that specify an If-Modified-Since header may receive a 304 Not Modified response if last_modified <= If-Modified-Since.

-
:public +
:public

By default the Cache-Control header is private. Set this option to true if you want your application to be cacheable by other devices, such as proxy caches.

-
:cache_control +
:cache_control

When given, will overwrite an existing Cache-Control header. For a list of Cache-Control directives, see the article on MDN.

-
:template +
:template

By default, the template digest for the current controller/action is included in ETags. If the action renders a different template, you can include its digest instead. If the action doesn’t render a template at all, you can pass template: false to skip any attempt to check for a template digest.

diff --git a/src/7.1/classes/ActionController/DataStreaming.html b/src/7.1/classes/ActionController/DataStreaming.html index e73f90a968..44a399f8c0 100644 --- a/src/7.1/classes/ActionController/DataStreaming.html +++ b/src/7.1/classes/ActionController/DataStreaming.html @@ -98,7 +98,7 @@

  • :filename - suggests a filename for the browser to use.

  • -

    :type - specifies an HTTP content type. Defaults to application/octet-stream. You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. If omitted, type will be inferred from the file extension specified in :filename. If no content type is registered for the extension, the default type application/octet-stream will be used.

    +

    :type - specifies an HTTP content type. Defaults to application/octet-stream. You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. If omitted, type will be inferred from the file extension specified in :filename. If no content type is registered for the extension, the default type application/octet-stream will be used.

  • :disposition - specifies whether the file will be shown inline or downloaded. Valid values are "inline" and "attachment" (default).

  • @@ -120,7 +120,7 @@

    send_data image.data, type: image.content_type, disposition: 'inline'
     
    -

    See send_file for more information on HTTP Content-* headers and caching.

    +

    See send_file for more information on HTTP Content-* headers and caching.

@@ -164,7 +164,7 @@

  • :filename - suggests a filename for the browser to use. Defaults to File.basename(path).

  • -

    :type - specifies an HTTP content type. You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. If omitted, the type will be inferred from the file extension specified in :filename. If no content type is registered for the extension, the default type application/octet-stream will be used.

    +

    :type - specifies an HTTP content type. You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. If omitted, the type will be inferred from the file extension specified in :filename. If no content type is registered for the extension, the default type application/octet-stream will be used.

  • :disposition - specifies whether the file will be shown inline or downloaded. Valid values are "inline" and "attachment" (default).

  • diff --git a/src/7.1/classes/ActionController/Helpers.html b/src/7.1/classes/ActionController/Helpers.html index cf70392df4..b32be5095d 100644 --- a/src/7.1/classes/ActionController/Helpers.html +++ b/src/7.1/classes/ActionController/Helpers.html @@ -27,7 +27,7 @@

    Action

    The Rails framework provides a large number of helpers for working with assets, dates, forms, numbers and model objects, to name a few. These helpers are available to all templates by default.

    -

    In addition to using the standard template helpers provided, creating custom helpers to extract complicated logic or reusable functionality is strongly encouraged. By default, each controller will include all helpers. These helpers are only accessible on the controller through #helpers

    +

    In addition to using the standard template helpers provided, creating custom helpers to extract complicated logic or reusable functionality is strongly encouraged. By default, each controller will include all helpers. These helpers are only accessible on the controller through helpers

    In previous versions of Rails the controller will include a helper which matches the name of the controller, e.g., MyController will automatically include MyHelper. You can revert to the old behavior with the following:

    diff --git a/src/7.1/classes/ActionController/HttpAuthentication/Token.html b/src/7.1/classes/ActionController/HttpAuthentication/Token.html index ac98a72fe6..48f60d3dfd 100644 --- a/src/7.1/classes/ActionController/HttpAuthentication/Token.html +++ b/src/7.1/classes/ActionController/HttpAuthentication/Token.html @@ -354,7 +354,7 @@

    -

    Takes raw_params and turns it into an array of parameters.

    +

    Takes raw_params and turns it into an array of parameters.

    @@ -389,7 +389,7 @@

    -

    This method takes an authorization body and splits up the key-value pairs by the standardized :, ;, or \t delimiters defined in AUTHN_PAIR_DELIMITERS.

    +

    This method takes an authorization body and splits up the key-value pairs by the standardized :, ;, or \t delimiters defined in AUTHN_PAIR_DELIMITERS.

    @@ -473,7 +473,7 @@

    Then the returned token is "abc", and the options are {nonce: "def"}.

    -

    Returns an Array of [String, Hash] if a token is present. Returns nil if no token is found.

    +

    Returns an Array of [String, Hash] if a token is present. Returns nil if no token is found.

    Parameters

    • diff --git a/src/7.1/classes/ActionController/Live.html b/src/7.1/classes/ActionController/Live.html index dc4a80301d..8c71bd8b90 100644 --- a/src/7.1/classes/ActionController/Live.html +++ b/src/7.1/classes/ActionController/Live.html @@ -257,7 +257,7 @@

      • :filename - suggests a filename for the browser to use.

      • -

        :type - specifies an HTTP content type. You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. If omitted, type will be inferred from the file extension specified in :filename. If no content type is registered for the extension, the default type ‘application/octet-stream’ will be used.

        +

        :type - specifies an HTTP content type. You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. If omitted, type will be inferred from the file extension specified in :filename. If no content type is registered for the extension, the default type ‘application/octet-stream’ will be used.

      • :disposition - specifies whether the file will be shown inline or downloaded. Valid values are ‘inline’ and ‘attachment’ (default).

      diff --git a/src/7.1/classes/ActionController/Metal.html b/src/7.1/classes/ActionController/Metal.html index e856d32e4c..dc8c564b9f 100644 --- a/src/7.1/classes/ActionController/Metal.html +++ b/src/7.1/classes/ActionController/Metal.html @@ -33,7 +33,7 @@

      Action Controller Metal

      -

      ActionController::Metal is the simplest possible controller, providing a valid Rack interface without the additional niceties provided by ActionController::Base.

      +

      ActionController::Metal is the simplest possible controller, providing a valid Rack interface without the additional niceties provided by ActionController::Base.

      A sample metal controller might look like this:

      @@ -53,7 +53,7 @@

      Action Cont

      Rendering Helpers

      -

      ActionController::Metal by default provides no utilities for rendering views, partials, or other responses aside from explicitly calling of response_body=, content_type=, and status=. To add the render helpers you’re used to having in a normal controller, you can do the following:

      +

      ActionController::Metal by default provides no utilities for rendering views, partials, or other responses aside from explicitly calling of response_body=, content_type=, and status=. To add the render helpers you’re used to having in a normal controller, you can do the following:

      class HelloController < ActionController::Metal
         include AbstractController::Rendering
      diff --git a/src/7.1/classes/ActionController/MimeResponds.html b/src/7.1/classes/ActionController/MimeResponds.html
      index ad17ef7b0a..438696980e 100644
      --- a/src/7.1/classes/ActionController/MimeResponds.html
      +++ b/src/7.1/classes/ActionController/MimeResponds.html
      @@ -177,7 +177,7 @@ 

      Mime::Type.register "image/jpeg", :jpg
       
      -

      respond_to also allows you to specify a common block for different formats by using any:

      +

      respond_to also allows you to specify a common block for different formats by using any:

      def index
         @people = Person.all
      diff --git a/src/7.1/classes/ActionController/Parameters.html b/src/7.1/classes/ActionController/Parameters.html
      index 85e7e3bb33..c702a891b1 100644
      --- a/src/7.1/classes/ActionController/Parameters.html
      +++ b/src/7.1/classes/ActionController/Parameters.html
      @@ -57,7 +57,7 @@ 

      A @@ -86,7 +86,7 @@

      A

      Please note that these options *are not thread-safe*. In a multi-threaded environment they should only be set once at boot-time and never mutated at runtime.

      -

      You can fetch values of ActionController::Parameters using either :key or "key".

      +

      You can fetch values of ActionController::Parameters using either :key or "key".

      params = ActionController::Parameters.new(key: "value")
       params[:key]  # => "value"
      @@ -481,7 +481,7 @@ 

      -

      Returns a new ActionController::Parameters instance. Also, sets the permitted attribute to the default value of ActionController::Parameters.permit_all_parameters.

      +

      Returns a new ActionController::Parameters instance. Also, sets the permitted attribute to the default value of ActionController::Parameters.permit_all_parameters.

      class Person < ActiveRecord::Base
       end
      @@ -542,7 +542,7 @@ 

      -

      Returns true if another Parameters object contains the same content and permitted flag.

      +

      Returns true if another Parameters object contains the same content and permitted flag.

      @@ -693,7 +693,7 @@

      -

      Returns a new ActionController::Parameters instance with nil values removed.

      +

      Returns a new ActionController::Parameters instance with nil values removed.

      @@ -763,7 +763,7 @@

      -

      Returns a new ActionController::Parameters instance without the blank values. Uses Object#blank? for determining if a value is blank.

      +

      Returns a new ActionController::Parameters instance without the blank values. Uses Object#blank? for determining if a value is blank.

      @@ -870,7 +870,7 @@

      -

      Returns a duplicate ActionController::Parameters instance with the same permitted parameters.

      +

      Returns a duplicate ActionController::Parameters instance with the same permitted parameters.

      @@ -908,7 +908,7 @@

      -

      Returns a new ActionController::Parameters instance with self and other_hash merged recursively.

      +

      Returns a new ActionController::Parameters instance with self and other_hash merged recursively.

      Like with Hash#merge in the standard library, a block can be provided to merge values.

      @@ -934,7 +934,7 @@

      -

      Same as #deep_merge, but modifies self.

      +

      Same as deep_merge, but modifies self.

      @@ -957,7 +957,7 @@

      -

      Returns a new ActionController::Parameters instance with the results of running block once for every key. This includes the keys from the root hash and from all nested hashes and arrays. The values are unchanged.

      +

      Returns a new ActionController::Parameters instance with the results of running block once for every key. This includes the keys from the root hash and from all nested hashes and arrays. The values are unchanged.

      @@ -994,7 +994,7 @@

      -

      Returns the same ActionController::Parameters instance with changed keys. This includes the keys from the root hash and from all nested hashes and arrays. The values are unchanged.

      +

      Returns the same ActionController::Parameters instance with changed keys. This includes the keys from the root hash and from all nested hashes and arrays. The values are unchanged.

      @@ -1030,7 +1030,7 @@

      -

      Deletes a key-value pair from Parameters and returns the value. If key is not found, returns nil (or, with optional code block, yields key and returns the result). This method is similar to extract!, which returns the corresponding ActionController::Parameters object.

      +

      Deletes a key-value pair from Parameters and returns the value. If key is not found, returns nil (or, with optional code block, yields key and returns the result). This method is similar to extract!, which returns the corresponding ActionController::Parameters object.

      @@ -1328,7 +1328,7 @@

      -

      Returns a new ActionController::Parameters instance that filters out the given keys.

      +

      Returns a new ActionController::Parameters instance that filters out the given keys.

      params = ActionController::Parameters.new(a: 1, b: 2, c: 3)
       params.except(:a, :b) # => #<ActionController::Parameters {"c"=>3} permitted: false>
      @@ -1483,7 +1483,7 @@ 

      -

      Returns a parameter for the given key. If the key can’t be found, there are several options: With no other arguments, it will raise an ActionController::ParameterMissing error; if a second argument is given, then that is returned (converted to an instance of ActionController::Parameters if possible); if a block is given, then that will be run and its result returned.

      +

      Returns a parameter for the given key. If the key can’t be found, there are several options: With no other arguments, it will raise an ActionController::ParameterMissing error; if a second argument is given, then that is returned (converted to an instance of ActionController::Parameters if possible); if a block is given, then that will be run and its result returned.

      params = ActionController::Parameters.new(person: { name: "Francesco" })
       params.fetch(:person)               # => #<ActionController::Parameters {"name"=>"Francesco"} permitted: false>
      @@ -1794,7 +1794,7 @@ 

      -

      Returns a new ActionController::Parameters instance with all keys from other_hash merged into current hash.

      +

      Returns a new ActionController::Parameters instance with all keys from other_hash merged into current hash.

      @@ -1832,7 +1832,7 @@

      -

      Returns the current ActionController::Parameters instance with other_hash merged into current hash.

      +

      Returns the current ActionController::Parameters instance with other_hash merged into current hash.

      @@ -1868,7 +1868,7 @@

      -

      Returns a new ActionController::Parameters instance that includes only the given filters and sets the permitted attribute for the object to true. This is useful for limiting which attributes should be allowed for mass updating.

      +

      Returns a new ActionController::Parameters instance that includes only the given filters and sets the permitted attribute for the object to true. This is useful for limiting which attributes should be allowed for mass updating.

      params = ActionController::Parameters.new(user: { name: "Francesco", age: 22, role: "admin" })
       permitted = params.require(:user).permit(:name, :age)
      @@ -1883,7 +1883,7 @@ 

      params.permit(:name)
       
      -

      :name passes if it is a key of params whose associated value is of type String, Symbol, NilClass, Numeric, TrueClass, FalseClass, Date, Time, DateTime, StringIO, IO, ActionDispatch::Http::UploadedFile or Rack::Test::UploadedFile. Otherwise, the key :name is filtered out.

      +

      :name passes if it is a key of params whose associated value is of type String, Symbol, NilClass, Numeric, TrueClass, FalseClass, Date, Time, DateTime, StringIO, IO, ActionDispatch::Http::UploadedFile or Rack::Test::UploadedFile. Otherwise, the key :name is filtered out.

      You may declare that the parameter should be an array of permitted scalars by mapping it to an empty array:

      @@ -2116,7 +2116,7 @@

      -

      Returns a new ActionController::Parameters instance with items that the block evaluates to true removed.

      +

      Returns a new ActionController::Parameters instance with items that the block evaluates to true removed.

      @@ -2313,7 +2313,7 @@

      -

      Returns a new ActionController::Parameters instance with all keys from current hash merged into other_hash.

      +

      Returns a new ActionController::Parameters instance with all keys from current hash merged into other_hash.

      @@ -2354,7 +2354,7 @@

      -

      Returns the current ActionController::Parameters instance with current hash merged into other_hash.

      +

      Returns the current ActionController::Parameters instance with current hash merged into other_hash.

      @@ -2394,7 +2394,7 @@

      -

      Returns a new ActionController::Parameters instance with only items that the block evaluates to true.

      +

      Returns a new ActionController::Parameters instance with only items that the block evaluates to true.

      @@ -2469,7 +2469,7 @@

      -

      Returns a new ActionController::Parameters instance that includes only the given keys. If the given keys don’t exist, returns an empty hash.

      +

      Returns a new ActionController::Parameters instance that includes only the given keys. If the given keys don’t exist, returns an empty hash.

      params = ActionController::Parameters.new(a: 1, b: 2, c: 3)
       params.slice(:a, :b) # => #<ActionController::Parameters {"a"=>1, "b"=>2} permitted: false>
      @@ -2509,7 +2509,7 @@ 

      -

      Returns the current ActionController::Parameters instance which contains only the given keys.

      +

      Returns the current ActionController::Parameters instance which contains only the given keys.

      @@ -2595,7 +2595,7 @@

      -

      Returns a safe Hash representation of the parameters with all unpermitted keys removed.

      +

      Returns a safe Hash representation of the parameters with all unpermitted keys removed.

      params = ActionController::Parameters.new({
         name: "Senjougahara Hitagi",
      @@ -2838,7 +2838,7 @@ 

      -

      Returns a new ActionController::Parameters instance with the results of running block once for every key. The values are unchanged.

      +

      Returns a new ActionController::Parameters instance with the results of running block once for every key. The values are unchanged.

      @@ -2876,7 +2876,7 @@

      -

      Performs keys transformation and returns the altered ActionController::Parameters instance.

      +

      Performs keys transformation and returns the altered ActionController::Parameters instance.

      @@ -2913,7 +2913,7 @@

      -

      Returns a new ActionController::Parameters instance with the results of running block once for every value. The keys are unchanged.

      +

      Returns a new ActionController::Parameters instance with the results of running block once for every value. The keys are unchanged.

      params = ActionController::Parameters.new(a: 1, b: 2, c: 3)
       params.transform_values { |x| x * 2 }
      @@ -2956,7 +2956,7 @@ 

      -

      Performs values transformation and returns the altered ActionController::Parameters instance.

      +

      Performs values transformation and returns the altered ActionController::Parameters instance.

      @@ -3053,7 +3053,7 @@

      -

      Returns values that were assigned to the given keys. Note that all the Hash objects will be converted to ActionController::Parameters.

      +

      Returns values that were assigned to the given keys. Note that all the Hash objects will be converted to ActionController::Parameters.

      diff --git a/src/7.1/classes/ActionController/ParamsWrapper.html b/src/7.1/classes/ActionController/ParamsWrapper.html index 84993ccb10..1d4b84c8cb 100644 --- a/src/7.1/classes/ActionController/ParamsWrapper.html +++ b/src/7.1/classes/ActionController/ParamsWrapper.html @@ -41,7 +41,7 @@

      ParamsWrapper for :json format, instead of having to send JSON parameters like this:

      {"user": {"name": "Konata"}}
       
      @@ -65,7 +65,7 @@

      ActiveModel object (such as User.new(params[:user])), you might consider passing the model class to the method instead. The ParamsWrapper will actually try to determine the list of attribute names from the model and only wrap those attributes:

      class UsersController < ApplicationController
         wrap_parameters Person
      @@ -74,7 +74,7 @@ 

      ParamsWrapper will actually try to determine if there’s a model related to it or not. This controller, for example:

      class Admin::UsersController < ApplicationController
       end
      diff --git a/src/7.1/classes/ActionController/ParamsWrapper/Options/ClassMethods.html b/src/7.1/classes/ActionController/ParamsWrapper/Options/ClassMethods.html
      index 9f4c3e23bb..8781b887da 100644
      --- a/src/7.1/classes/ActionController/ParamsWrapper/Options/ClassMethods.html
      +++ b/src/7.1/classes/ActionController/ParamsWrapper/Options/ClassMethods.html
      @@ -149,7 +149,7 @@ 

      -

      Sets the name of the wrapper key, or the model which ParamsWrapper would use to determine the attribute names from.

      +

      Sets the name of the wrapper key, or the model which ParamsWrapper would use to determine the attribute names from.

      Examples

      diff --git a/src/7.1/classes/ActionController/Redirecting.html b/src/7.1/classes/ActionController/Redirecting.html index b61bf722b7..d3bd58192e 100644 --- a/src/7.1/classes/ActionController/Redirecting.html +++ b/src/7.1/classes/ActionController/Redirecting.html @@ -213,15 +213,15 @@

      Redirects the browser to the target specified in options. This parameter can be any one of:

      • -

        Hash - The URL will be generated by calling url_for with the options.

        +

        Hash - The URL will be generated by calling url_for with the options.

      • Record - The URL will be generated by calling url_for with the options, which will reference a named URL for that record.

      • -

        String starting with protocol:// (like http://) or a protocol relative reference (like //) - Is passed straight through as the target for redirection.

        +

        String starting with protocol:// (like http://) or a protocol relative reference (like //) - Is passed straight through as the target for redirection.

      • -

        String not containing a protocol - The current protocol and host is prepended to the string.

        +

        String not containing a protocol - The current protocol and host is prepended to the string.

      • -

        Proc - A block that will be executed in the controller’s context. Should return any option accepted by redirect_to.

        +

        Proc - A block that will be executed in the controller’s context. Should return any option accepted by redirect_to.

      Examples

      @@ -258,7 +258,7 @@

      Examples

      redirect_to({ action: 'atom' }, alert: "Something serious happened")

      -

      Statements after redirect_to in our controller get executed, so redirect_to doesn’t stop the execution of the function. To terminate the execution of the function immediately after the redirect_to, use return.

      +

      Statements after redirect_to in our controller get executed, so redirect_to doesn’t stop the execution of the function. To terminate the execution of the function immediately after the redirect_to, use return.

      redirect_to post_url(@post) and return
       
      @@ -344,7 +344,7 @@

      url_from("https://dev.example.com/profile") # => nil

      -

      NOTE: there’s a similarity with url_for, which generates an internal URL from various options from within the app, e.g. url_for(@post). However, url_from is meant to take an external parameter to verify as in url_from(params[:redirect_url]).

      +

      NOTE: there’s a similarity with url_for, which generates an internal URL from various options from within the app, e.g. post) at url_for(. However, url_from is meant to take an external parameter to verify as in url_from(params[:redirect_url]).

      diff --git a/src/7.1/classes/ActionController/Renderer.html b/src/7.1/classes/ActionController/Renderer.html index e8c5464474..84cbc677a8 100644 --- a/src/7.1/classes/ActionController/Renderer.html +++ b/src/7.1/classes/ActionController/Renderer.html @@ -217,7 +217,7 @@

      Parameter

      defaults - Default values for the Rack env. Entries are specified in the same format as env. env will be merged on top of these values. defaults will be retained when calling new on a renderer instance.

    -

    If no http_host is specified, the env HTTP host will be derived from the routes’ default_url_options. In this case, the https boolean and the script_name will also be derived from default_url_options if they were not specified. Additionally, the https boolean will fall back to Rails.application.config.force_ssl if default_url_options does not specify a protocol.

    +

    If no http_host is specified, the env HTTP host will be derived from the routes’ default_url_options. In this case, the https boolean and the script_name will also be derived from default_url_options if they were not specified. Additionally, the https boolean will fall back to Rails.application.config.force_ssl if default_url_options does not specify a protocol.

    diff --git a/src/7.1/classes/ActionController/Renderers.html b/src/7.1/classes/ActionController/Renderers.html index fced56d31e..f9f8ee4fc3 100644 --- a/src/7.1/classes/ActionController/Renderers.html +++ b/src/7.1/classes/ActionController/Renderers.html @@ -161,7 +161,7 @@

    end -

    Note that we used Mime for the csv mime type as it comes with Rails. For a custom renderer, you’ll need to register a mime type with Mime::Type.register.

    +

    Note that we used Mime for the csv mime type as it comes with Rails. For a custom renderer, you’ll need to register a mime type with Mime::Type.register.

    To use the csv renderer in a controller action:

    @@ -298,7 +298,7 @@

    Called by render in AbstractController::Rendering which sets the return value as the response_body.

    -

    If no renderer is found, super returns control to ActionView::Rendering.render_to_body, if present.

    +

    If no renderer is found, super returns control to ActionView::Rendering.render_to_body, if present.

    diff --git a/src/7.1/classes/ActionController/Renderers/ClassMethods.html b/src/7.1/classes/ActionController/Renderers/ClassMethods.html index a408c45809..96ec963195 100644 --- a/src/7.1/classes/ActionController/Renderers/ClassMethods.html +++ b/src/7.1/classes/ActionController/Renderers/ClassMethods.html @@ -103,7 +103,7 @@

    Since ActionController::Metal controllers cannot render, the controller must include AbstractController::Rendering, ActionController::Rendering, and ActionController::Renderers, and have at least one renderer.

    -

    Rather than including ActionController::Renderers::All and including all renderers, you may specify which renderers to include by passing the renderer name or names to use_renderers. For example, a controller that includes only the :json renderer (_render_with_renderer_json) might look like:

    +

    Rather than including ActionController::Renderers::All and including all renderers, you may specify which renderers to include by passing the renderer name or names to use_renderers. For example, a controller that includes only the :json renderer (_render_with_renderer_json) might look like:

    class MetalRenderingController < ActionController::Metal
       include AbstractController::Rendering
    @@ -118,7 +118,7 @@ 

    end

    -

    You must specify a use_renderer, else the controller.renderer and controller._renderers will be nil, and the action will fail.

    +

    You must specify a use_renderer, else the controller.renderer and controller._renderers will be nil, and the action will fail.

    diff --git a/src/7.1/classes/ActionController/Rendering.html b/src/7.1/classes/ActionController/Rendering.html index ac02d45f37..1a02736c1b 100644 --- a/src/7.1/classes/ActionController/Rendering.html +++ b/src/7.1/classes/ActionController/Rendering.html @@ -111,21 +111,21 @@

    If the first argument responds to render_in, the template will be rendered by calling render_in with the current view context.

    Rendering Mode

    -
    :partial +
    :partial

    See ActionView::PartialRenderer for details.

    render partial: "posts/form", locals: { post: Post.new }
     # => renders app/views/posts/_form.html.erb
     
    -
    :file +
    :file

    Renders the contents of a file. This option should not be used with unsanitized user input.

    render file: "/path/to/some/file"
     # => renders /path/to/some/file
     
    -
    :inline +
    :inline

    Renders an ERB template string.

    @@ -133,21 +133,21 @@

    Rendering Mode

    render inline: "<h1>Hello, <%= @name %>!</h1>" # => renders "<h1>Hello, World!</h1>" -
    :body +
    :body

    Renders the provided text, and sets the content type as text/plain.

    render body: "Hello, World!"
     # => renders "Hello, World!"
     
    -
    :plain +
    :plain

    Renders the provided text, and sets the content type as text/plain.

    render plain: "Hello, World!"
     # => renders "Hello, World!"
     
    -
    :html +
    :html

    Renders the provided HTML string, and sets the content type as text/html. If the string is not html_safe?, performs HTML escaping on the string before rendering.

    @@ -157,7 +157,7 @@

    Rendering Mode

    render html: "<h1>Hello, World!</h1>" # => renders "&lt;h1&gt;Hello, World!&lt;/h1&gt;" -
    :json +
    :json

    Renders the provided object as JSON, and sets the content type as application/json. If the object is not a string, it will be converted to JSON by calling to_json.

    @@ -169,21 +169,21 @@

    Rendering Mode

    By default, when a rendering mode is specified, no layout template is rendered.

    Options

    -
    :assigns +
    :assigns

    Hash of instance variable assignments for the template.

    render inline: "<h1>Hello, <%= @name %>!</h1>", assigns: { name: "World" }
     # => renders "<h1>Hello, World!</h1>"
     
    -
    :locals +
    :locals

    Hash of local variable assignments for the template.

    render inline: "<h1>Hello, <%= name %>!</h1>", locals: { name: "World" }
     # => renders "<h1>Hello, World!</h1>"
     
    -
    :layout +
    :layout

    The layout template to render. Can also be false or true to disable or (re)enable the default layout template.

    @@ -196,7 +196,7 @@

    Options

    render inline: "<h1>Hello, World!</h1>", layout: true # => renders "<h1>Hello, World!</h1>" with the default layout -
    :status +
    :status

    The HTTP status code to send with the response. Can be specified as a number or as the status name in Symbol form. Defaults to 200.

    diff --git a/src/7.1/classes/ActionController/RequestForgeryProtection.html b/src/7.1/classes/ActionController/RequestForgeryProtection.html index 249b453cee..f27f311f0a 100644 --- a/src/7.1/classes/ActionController/RequestForgeryProtection.html +++ b/src/7.1/classes/ActionController/RequestForgeryProtection.html @@ -715,7 +715,7 @@

    -

    If the verify_authenticity_token before_action ran, verify that JavaScript responses are only served to same-origin GET requests.

    +

    If the verify_authenticity_token before_action ran, verify that JavaScript responses are only served to same-origin GET requests.

    @@ -1277,7 +1277,7 @@

    -

    If verify_authenticity_token was run (indicating that we have forgery protection enabled for this request) then also verify that we aren’t serving an unauthorized cross-origin response.

    +

    If verify_authenticity_token was run (indicating that we have forgery protection enabled for this request) then also verify that we aren’t serving an unauthorized cross-origin response.

    diff --git a/src/7.1/classes/ActionController/TestCase.html b/src/7.1/classes/ActionController/TestCase.html index cf50f0b609..3724047337 100644 --- a/src/7.1/classes/ActionController/TestCase.html +++ b/src/7.1/classes/ActionController/TestCase.html @@ -76,13 +76,13 @@

    Basic example

    Special instance variables

    ActionController::TestCase will also automatically provide the following instance variables for use in the tests:

    -
    @controller +
    @controller

    The controller instance that will be tested.

    -
    @request +
    @request

    An ActionController::TestRequest, representing the current HTTP request. You can modify this object before sending the HTTP request. For example, you might want to set some session properties before sending a GET request.

    -
    @response +
    @response

    An ActionDispatch::TestResponse object, representing the response of the last HTTP response. In the above example, @response becomes valid after calling post. If the various assert methods are not sufficient, then you may use this object to inspect the HTTP response in detail.

    diff --git a/src/7.1/classes/ActionController/TestCase/Behavior/ClassMethods.html b/src/7.1/classes/ActionController/TestCase/Behavior/ClassMethods.html index 2ac9525abc..8f3dde5a36 100644 --- a/src/7.1/classes/ActionController/TestCase/Behavior/ClassMethods.html +++ b/src/7.1/classes/ActionController/TestCase/Behavior/ClassMethods.html @@ -189,7 +189,7 @@

    -

    Sets the controller class name. Useful if the name can’t be inferred from test class. Normalizes controller_class before using.

    +

    Sets the controller class name. Useful if the name can’t be inferred from test class. Normalizes controller_class before using.

    tests WidgetController
     tests :widget
    diff --git a/src/7.1/classes/ActionDispatch/Assertions/RoutingAssertions.html b/src/7.1/classes/ActionDispatch/Assertions/RoutingAssertions.html
    index 14f7316f25..c048546ac5 100644
    --- a/src/7.1/classes/ActionDispatch/Assertions/RoutingAssertions.html
    +++ b/src/7.1/classes/ActionDispatch/Assertions/RoutingAssertions.html
    @@ -101,7 +101,7 @@ 

    -

    Asserts that the provided options can be used to generate the provided path. This is the inverse of assert_recognizes. The extras parameter is used to tell the request the names and values of additional request parameters that would be in a query string. The message parameter allows you to specify a custom error message for assertion failures.

    +

    Asserts that the provided options can be used to generate the provided path. This is the inverse of assert_recognizes. The extras parameter is used to tell the request the names and values of additional request parameters that would be in a query string. The message parameter allows you to specify a custom error message for assertion failures.

    The defaults parameter is unused.

    @@ -248,7 +248,7 @@

    -

    Asserts that path and options match both ways; in other words, it verifies that path generates options and then that options generates path. This essentially combines assert_recognizes and assert_generates into one step.

    +

    Asserts that path and options match both ways; in other words, it verifies that path generates options and then that options generates path. This essentially combines assert_recognizes and assert_generates into one step.

    The extras hash allows you to specify options that would normally be provided as a query string to the action. The message parameter allows you to specify a custom error message to display upon failure.

    diff --git a/src/7.1/classes/ActionDispatch/Cookies.html b/src/7.1/classes/ActionDispatch/Cookies.html index 6c1330d664..65f3aec036 100644 --- a/src/7.1/classes/ActionDispatch/Cookies.html +++ b/src/7.1/classes/ActionDispatch/Cookies.html @@ -99,7 +99,7 @@

  • :path - The path for which this cookie applies. Defaults to the root of the application.

  • -

    :domain - The domain for which this cookie applies so you can restrict to the domain level. If you use a schema like www.example.com and want to share session with user.example.com set :domain to :all. To support multiple domains, provide an array, and the first domain matching request.host will be used. Make sure to specify the :domain option with :all or Array again when deleting cookies. For more flexibility you can set the domain on a per-request basis by specifying :domain with a proc.

    +

    :domain - The domain for which this cookie applies so you can restrict to the domain level. If you use a schema like www.example.com and want to share session with user.example.com set :domain to :all. To support multiple domains, provide an array, and the first domain matching request.host will be used. Make sure to specify the :domain option with :all or Array again when deleting cookies. For more flexibility you can set the domain on a per-request basis by specifying :domain with a proc.

    domain: nil  # Does not set cookie domain. (default)
     domain: :all # Allow the cookie for the top most level
    diff --git a/src/7.1/classes/ActionDispatch/Http/Cache/Response.html b/src/7.1/classes/ActionDispatch/Http/Cache/Response.html
    index d5d2ebf2ad..902f6e8c5f 100644
    --- a/src/7.1/classes/ActionDispatch/Http/Cache/Response.html
    +++ b/src/7.1/classes/ActionDispatch/Http/Cache/Response.html
    @@ -304,7 +304,7 @@ 

    Weak ETags are considered to be semantically equivalent but not byte-for-byte identical. This is perfect for browser caching of HTML pages where we don’t care about exact equality, just what the user is viewing.

    -

    Strong ETags are considered byte-for-byte identical. They allow a browser or proxy cache to support Range requests, useful for paging through a PDF file or scrubbing through a video. Some CDNs only support strong ETags and will ignore weak ETags entirely.

    +

    Strong ETags are considered byte-for-byte identical. They allow a browser or proxy cache to support Range requests, useful for paging through a PDF file or scrubbing through a video. Some CDNs only support strong ETags and will ignore weak ETags entirely.

    Weak ETags are what we almost always need, so they’re the default. Check out strong_etag= to provide a strong ETag validator.

    diff --git a/src/7.1/classes/ActionDispatch/Http/FilterParameters.html b/src/7.1/classes/ActionDispatch/Http/FilterParameters.html index f656e138da..1b0670f891 100644 --- a/src/7.1/classes/ActionDispatch/Http/FilterParameters.html +++ b/src/7.1/classes/ActionDispatch/Http/FilterParameters.html @@ -257,7 +257,7 @@

    -

    Returns the ActiveSupport::ParameterFilter object used to filter in this request.

    +

    Returns the ActiveSupport::ParameterFilter object used to filter in this request.

    diff --git a/src/7.1/classes/ActionDispatch/Integration/Session.html b/src/7.1/classes/ActionDispatch/Integration/Session.html index 43b76d65a3..bf24ec80e5 100644 --- a/src/7.1/classes/ActionDispatch/Integration/Session.html +++ b/src/7.1/classes/ActionDispatch/Integration/Session.html @@ -418,7 +418,7 @@

    as: Used for encoding the request with different content type. Supports :json by default and will set the appropriate request headers. The headers will be merged into the Rack env hash.

-

This method is rarely used directly. Use RequestHelpers#get, RequestHelpers#post, or other standard HTTP methods in integration tests. #process is only required when using a request method that doesn’t have a method defined in the integration tests.

+

This method is rarely used directly. Use RequestHelpers#get, RequestHelpers#post, or other standard HTTP methods in integration tests. process is only required when using a request method that doesn’t have a method defined in the integration tests.

This method returns the response status, after performing the request. Furthermore, if this method was called from an ActionDispatch::IntegrationTest object, then that object’s @response instance variable will point to a Response object which one can use to inspect the details of the response.

diff --git a/src/7.1/classes/ActionDispatch/IntegrationTest.html b/src/7.1/classes/ActionDispatch/IntegrationTest.html index 6c88900ab2..ffef1757f2 100644 --- a/src/7.1/classes/ActionDispatch/IntegrationTest.html +++ b/src/7.1/classes/ActionDispatch/IntegrationTest.html @@ -31,7 +31,7 @@

An integration test spans multiple controllers and actions, tying them all together to ensure they work together as expected. It tests more completely than either unit or functional tests do, exercising the entire stack, from the dispatcher to the database.

-

At its simplest, you simply extend IntegrationTest and write your tests using the Integration::RequestHelpers#get and/or Integration::RequestHelpers#post methods:

+

At its simplest, you simply extend IntegrationTest and write your tests using the Integration::RequestHelpers#get and/or Integration::RequestHelpers#post methods:

require "test_helper"
 
diff --git a/src/7.1/classes/ActionDispatch/RemoteIp.html b/src/7.1/classes/ActionDispatch/RemoteIp.html
index 2f60f92461..266ff478ad 100644
--- a/src/7.1/classes/ActionDispatch/RemoteIp.html
+++ b/src/7.1/classes/ActionDispatch/RemoteIp.html
@@ -149,11 +149,11 @@ 

-

Create a new RemoteIp middleware instance.

+

Create a new RemoteIp middleware instance.

The ip_spoofing_check option is on by default. When on, an exception is raised if it looks like the client is trying to lie about its own IP address. It makes sense to turn off this check on sites aimed at non-IP clients (like WAP devices), or behind proxies that set headers in an incorrect or confusing way (like AWS ELB).

-

The custom_proxies argument can take an enumerable which will be used instead of TRUSTED_PROXIES. Any proxy setup will put the value you want in the middle (or at the beginning) of the X-Forwarded-For list, with your proxy servers after it. If your proxies aren’t removed, pass them in via the custom_proxies parameter. That way, the middleware will ignore those IP addresses, and return the one that you want.

+

The custom_proxies argument can take an enumerable which will be used instead of TRUSTED_PROXIES. Any proxy setup will put the value you want in the middle (or at the beginning) of the X-Forwarded-For list, with your proxy servers after it. If your proxies aren’t removed, pass them in via the custom_proxies parameter. That way, the middleware will ignore those IP addresses, and return the one that you want.

diff --git a/src/7.1/classes/ActionDispatch/Request.html b/src/7.1/classes/ActionDispatch/Request.html index f2ac6d8f0c..99802245d5 100644 --- a/src/7.1/classes/ActionDispatch/Request.html +++ b/src/7.1/classes/ActionDispatch/Request.html @@ -943,7 +943,7 @@

-

Returns the String full path including params of the last URL requested.

+

Returns the String full path including params of the last URL requested.

# get "/articles"
 request.fullpath # => "/articles"
@@ -1058,7 +1058,7 @@ 

-

Returns the IP address of client as a String.

+

Returns the IP address of client as a String.

@@ -1201,7 +1201,7 @@

-

The String MIME type of the request.

+

The String MIME type of the request.

# get "/articles"
 request.media_type # => "application/x-www-form-urlencoded"
@@ -1319,7 +1319,7 @@ 

-

Returns a String with the last requested path including their params.

+

Returns a String with the last requested path including their params.

# get '/foo'
 request.original_fullpath # => '/foo'
@@ -1361,7 +1361,7 @@ 

-

Returns the original request URL as a String.

+

Returns the original request URL as a String.

# get "/articles?page=2"
 request.original_url # => "http://www.example.com/articles?page=2"
@@ -1463,7 +1463,7 @@ 

-

Returns the IP address of client as a String, usually set by the RemoteIp middleware.

+

Returns the IP address of client as a String, usually set by the RemoteIp middleware.

@@ -1819,7 +1819,7 @@

If the env contains rack.early_hints then the server accepts HTTP2 push for link headers.

-

The send_early_hints method accepts a hash of links as follows:

+

The send_early_hints method accepts a hash of links as follows:

send_early_hints("link" => "</style.css>; rel=preload; as=style,</script.js>; rel=preload")
 
diff --git a/src/7.1/classes/ActionDispatch/Routing/Mapper/Base.html b/src/7.1/classes/ActionDispatch/Routing/Mapper/Base.html index 7646153f48..292f5aec0c 100644 --- a/src/7.1/classes/ActionDispatch/Routing/Mapper/Base.html +++ b/src/7.1/classes/ActionDispatch/Routing/Mapper/Base.html @@ -240,13 +240,13 @@

Options

Any options not seen here are passed on as params with the URL.

-
:controller +
:controller

The route’s controller.

-
:action +
:action

The route’s action.

-
:param +
:param

Overrides the default resource identifier :id (name of the dynamic segment used to generate the routes). You can access that segment from your controller using params[<:param>]. In your router:

@@ -264,7 +264,7 @@

Options

DELETE /users/:name(.:format)
-

You can override ActiveRecord::Base#to_param of a related model to construct a URL:

+

You can override ActiveRecord::Base#to_param of a related model to construct a URL:

class User < ActiveRecord::Base
   def to_param
@@ -275,10 +275,10 @@ 

Options

user = User.find_by(name: 'Phusion') user_path(user) # => "/users/Phusion"
-
:path +
:path

The path prefix for the routes.

-
:module +
:module

The namespace for :controller.

@@ -286,11 +286,11 @@

Options

# => Sekret::PostsController

-

See Scoping#namespace for its scope equivalent.

-
:as +

See Scoping#namespace for its scope equivalent.

+
:as

The name used to generate routing helpers.

-
:via +
:via

Allowed HTTP verb(s) for route.

@@ -298,7 +298,7 @@

Options

match 'path', to: 'c#a', via: [:get, :post] match 'path', to: 'c#a', via: :all

-
:to +
:to

Points to a Rack endpoint. Can be an object that responds to call or a string representing a controller’s action.

@@ -306,7 +306,7 @@

Options

match 'path', to: -> (env) { [200, {}, ["Success!"]] }, via: :get match 'path', to: RackApp, via: :get

-
:on +
:on

Shorthand for wrapping routes in a specific RESTful context. Valid values are :member, :collection, and :new. Only use within resource(s) block. For example:

@@ -323,7 +323,7 @@

Options

end end

-
:constraints +
:constraints

Constrains parameters with a hash of regular expressions or an object that responds to matches?. In addition, constraints other than path can also be specified with any object that responds to === (e.g. String, Array, Range, etc.).

@@ -337,8 +337,8 @@

Options

match 'path', to: 'c#a', constraints: PermitList.new, via: :get -

See Scoping#constraints for more examples with its scope equivalent.

-
:defaults +

See Scoping#constraints for more examples with its scope equivalent.

+
:defaults

Sets defaults for parameters

@@ -346,15 +346,15 @@

Options

match 'path', to: 'c#a', defaults: { format: 'jpg' }, via: :get -

See Scoping#defaults for its scope equivalent.

-
:anchor +

See Scoping#defaults for its scope equivalent.

+
:anchor

Boolean to anchor a match pattern. Default is true. When set to false, the pattern matches any request prefixed with the given path.

# Matches any request starting with 'path'
 match 'path', to: 'c#a', anchor: false, via: :get
 
-
:format +
:format

Allows you to specify the default value for optional format segment or disable it by supplying false.

diff --git a/src/7.1/classes/ActionDispatch/Routing/Mapper/CustomUrls.html b/src/7.1/classes/ActionDispatch/Routing/Mapper/CustomUrls.html index 96967d8357..708cbd333c 100644 --- a/src/7.1/classes/ActionDispatch/Routing/Mapper/CustomUrls.html +++ b/src/7.1/classes/ActionDispatch/Routing/Mapper/CustomUrls.html @@ -112,7 +112,7 @@

Rails.application.routes.url_helpers.browse_path
 
-

then it will raise a NameError. Because of this you need to be aware of the context in which you will use your custom URL helper when defining it.

+

then it will raise a NameError. Because of this you need to be aware of the context in which you will use your custom URL helper when defining it.

NOTE: The direct method can’t be used inside of a scope block such as namespace or scope and will raise an error if it detects that it is.

diff --git a/src/7.1/classes/ActionDispatch/Routing/Mapper/Resources.html b/src/7.1/classes/ActionDispatch/Routing/Mapper/Resources.html index df43a14d42..1e2b292985 100644 --- a/src/7.1/classes/ActionDispatch/Routing/Mapper/Resources.html +++ b/src/7.1/classes/ActionDispatch/Routing/Mapper/Resources.html @@ -243,7 +243,7 @@

-

Loads another routes file with the given name located inside the config/routes directory. In that file, you can use the normal routing DSL, but do not surround it with a Rails.application.routes.draw block.

+

Loads another routes file with the given name located inside the config/routes directory. In that file, you can use the normal routing DSL, but do not surround it with a Rails.application.routes.draw block.

# config/routes.rb
 Rails.application.routes.draw do
@@ -687,7 +687,7 @@ 

Options

Takes same options as match as well as:

-
:path_names +
:path_names

Allows you to change the segment component of the edit and new actions. Actions not specified are not changed.

@@ -695,7 +695,7 @@

Options

The above example will now change /posts/new to /posts/brand_new.

-
:path +
:path

Allows you to change the path prefix for the resource.

@@ -703,21 +703,21 @@

Options

The resource and all segments will now route to /postings instead of /posts.

-
:only +
:only

Only generate routes for the given actions.

resources :cows, only: :show
 resources :cows, only: [:show, :index]
 
-
:except +
:except

Generate all routes except for the given actions.

resources :cows, except: :show
 resources :cows, except: [:show, :index]
 
-
:shallow +
:shallow

Generates shallow routes for nested resource(s). When placed on a parent resource, generates shallow routes for all nested resources.

@@ -737,7 +737,7 @@

Options

This allows URLs for resources that otherwise would be deeply nested such as a comment on a blog post like /posts/a-long-permalink/comments/1234 to be shortened to just /comments/1234.

Set shallow: false on a child resource to ignore a parent’s shallow parameter.

-
:shallow_path +
:shallow_path

Prefixes nested shallow routes with the specified path.

@@ -758,7 +758,7 @@

Options

comment PATCH/PUT /sekret/comments/:id(.:format) comment DELETE /sekret/comments/:id(.:format) -
:shallow_prefix +
:shallow_prefix

Prefixes nested shallow route names with specified prefix.

@@ -779,10 +779,10 @@

Options

sekret_comment PATCH/PUT /comments/:id(.:format) sekret_comment DELETE /comments/:id(.:format) -
:format +
:format

Allows you to specify the default value for optional format segment or disable it by supplying false.

-
:param +
:param

Allows you to override the default param name of :id in the URL.

diff --git a/src/7.1/classes/ActionDispatch/Routing/Mapper/Scoping.html b/src/7.1/classes/ActionDispatch/Routing/Mapper/Scoping.html index d0f215348b..8c651e89eb 100644 --- a/src/7.1/classes/ActionDispatch/Routing/Mapper/Scoping.html +++ b/src/7.1/classes/ActionDispatch/Routing/Mapper/Scoping.html @@ -340,7 +340,7 @@

Options

The :path, :as, :module, :shallow_path, and :shallow_prefix options all default to the name of the namespace.

-

For options, see Base#match. For :shallow_path option, see Resources#resources.

+

For options, see Base#match. For :shallow_path option, see Resources#resources.

# accessible through /sekret/posts rather than /admin/posts
 namespace :admin, path: "sekret" do
@@ -415,7 +415,7 @@ 

Options

-

Takes same options as Base#match and Resources#resources.

+

Takes same options as Base#match and Resources#resources.

# route /posts (without the prefix /admin) to +Admin::PostsController+
 scope module: "admin" do
diff --git a/src/7.1/classes/ActionDispatch/Routing/PolymorphicRoutes.html b/src/7.1/classes/ActionDispatch/Routing/PolymorphicRoutes.html
index ec1214f313..f57af59c31 100644
--- a/src/7.1/classes/ActionDispatch/Routing/PolymorphicRoutes.html
+++ b/src/7.1/classes/ActionDispatch/Routing/PolymorphicRoutes.html
@@ -45,9 +45,9 @@ 

ActionView::Helpers::FormHelper uses polymorphic_path, so you can write form_for(@article) without having to specify :url parameter for the form action;

+

ActionView::Helpers::FormHelper uses polymorphic_path, so you can write article) at form_for( without having to specify :url parameter for the form action;

  • redirect_to (which, in fact, uses url_for) so you can write redirect_to(post) in your controllers;

  • @@ -56,7 +56,7 @@

    Prefixed polymorphic helpers

    -

    In addition to polymorphic_url and polymorphic_path methods, a number of prefixed helpers are available as a shorthand to action: "..." in options. Those are:

    +

    In addition to polymorphic_url and polymorphic_path methods, a number of prefixed helpers are available as a shorthand to action: "..." in options. Those are:

    • edit_polymorphic_url, edit_polymorphic_path

    • diff --git a/src/7.1/classes/ActionDispatch/Routing/UrlFor.html b/src/7.1/classes/ActionDispatch/Routing/UrlFor.html index 37749fe0f8..13abc2c8a5 100644 --- a/src/7.1/classes/ActionDispatch/Routing/UrlFor.html +++ b/src/7.1/classes/ActionDispatch/Routing/UrlFor.html @@ -29,7 +29,7 @@

      ActionDispatch::Routing for general information about routing and config/routes.rb.

      -

      Tip: If you need to generate URLs from your models or some other place, then ActionDispatch::Routing::UrlFor is what you’re looking for. Read on for an introduction. In general, this module should not be included on its own, as it is usually included by url_helpers (as in Rails.application.routes.url_helpers).

      +

      Tip: If you need to generate URLs from your models or some other place, then ActionDispatch::Routing::UrlFor is what you’re looking for. Read on for an introduction. In general, this module should not be included on its own, as it is usually included by url_helpers (as in Rails.application.routes.url_helpers).

      URL generation from parameters

      @@ -60,7 +60,7 @@

      url_for, that already knows what the current hostname is. So if you use url_for in your controllers or your views, then you don’t need to explicitly pass the :host argument.

      For convenience, mailers also include ActionDispatch::Routing::UrlFor. So within mailers, you can use url_for. However, mailers cannot access incoming web requests in order to derive hostname information, so you have to provide the :host option or set the default host using default_url_options. For more information on url_for in mailers see the ActionMailer::Base documentation.

      @@ -71,7 +71,7 @@

      Rails.application.routes.url_helpers in your class:

      class User < ActiveRecord::Base
         include Rails.application.routes.url_helpers
      @@ -287,7 +287,7 @@ 

      :script_name - Specifies application path relative to domain root. If provided, prepends application path.

    -

    Any other key (:controller, :action, etc.) given to url_for is forwarded to the Routes module.

    +

    Any other key (:controller, :action, etc.) given to url_for is forwarded to the Routes module.

    url_for controller: 'tasks', action: 'testing', host: 'somehost.org', port: '8080'
     # => 'http://somehost.org:8080/tasks/testing'
    @@ -310,7 +310,7 @@ 

    url_for(only_path: true, action: 'edit', id: 2) # => '/users/2/edit'

    -

    Notice that no :id parameter was provided to the first url_for call and the helper used the one from the route’s path. Any path parameter implicitly used by url_for can always be overwritten like shown on the last url_for calls.

    +

    Notice that no :id parameter was provided to the first url_for call and the helper used the one from the route’s path. Any path parameter implicitly used by url_for can always be overwritten like shown on the last url_for calls.

  • diff --git a/src/7.1/classes/ActionDispatch/Session/CacheStore.html b/src/7.1/classes/ActionDispatch/Session/CacheStore.html index 0690442663..9bf18f069a 100644 --- a/src/7.1/classes/ActionDispatch/Session/CacheStore.html +++ b/src/7.1/classes/ActionDispatch/Session/CacheStore.html @@ -35,7 +35,7 @@

    Options

    • -

      cache - The cache to use. If it is not specified, Rails.cache will be used.

      +

      cache - The cache to use. If it is not specified, Rails.cache will be used.

    • expire_after - The length of time a session will be stored before automatically expiring. By default, the :expires_in option of the cache is used.

    diff --git a/src/7.1/classes/ActionDispatch/ShowExceptions.html b/src/7.1/classes/ActionDispatch/ShowExceptions.html index cf8886bc27..9b25f91196 100644 --- a/src/7.1/classes/ActionDispatch/ShowExceptions.html +++ b/src/7.1/classes/ActionDispatch/ShowExceptions.html @@ -33,7 +33,7 @@

    ShowExceptions. Every time there is an exception, ShowExceptions will store the exception in env["action_dispatch.exception"], rewrite the PATH_INFO to the exception status code, and call the Rack app.

    In Rails applications, the exceptions app can be configured with config.exceptions_app, which defaults to ActionDispatch::PublicExceptions.

    diff --git a/src/7.1/classes/ActionDispatch/SystemTestCase.html b/src/7.1/classes/ActionDispatch/SystemTestCase.html index 036cacfc2b..354b850883 100644 --- a/src/7.1/classes/ActionDispatch/SystemTestCase.html +++ b/src/7.1/classes/ActionDispatch/SystemTestCase.html @@ -61,7 +61,7 @@

    System Testin end -

    By default, ActionDispatch::SystemTestCase is driven by the Selenium driver, with the Chrome browser, and a browser size of 1400x1400.

    +

    By default, ActionDispatch::SystemTestCase is driven by the Selenium driver, with the Chrome browser, and a browser size of 1400x1400.

    Changing the driver configuration options is easy. Let’s say you want to use the Firefox browser instead of Chrome. In your application_system_test_case.rb file add the following:

    @@ -72,7 +72,7 @@

    System Testin end -

    driven_by has a required argument for the driver name. The keyword arguments are :using for the browser and :screen_size to change the size of the browser screen. These two options are not applicable for headless drivers and will be silently ignored if passed.

    +

    driven_by has a required argument for the driver name. The keyword arguments are :using for the browser and :screen_size to change the size of the browser screen. These two options are not applicable for headless drivers and will be silently ignored if passed.

    Headless browsers such as headless Chrome and headless Firefox are also supported. You can use these browsers by setting the :using argument to :headless_chrome or :headless_firefox.

    @@ -101,7 +101,7 @@

    System Testin end -

    Because ActionDispatch::SystemTestCase is a shim between Capybara and Rails, any driver that is supported by Capybara is supported by system tests as long as you include the required gems and files.

    +

    Because ActionDispatch::SystemTestCase is a shim between Capybara and Rails, any driver that is supported by Capybara is supported by system tests as long as you include the required gems and files.

    diff --git a/src/7.1/classes/ActionDispatch/SystemTesting/TestHelpers/ScreenshotHelper.html b/src/7.1/classes/ActionDispatch/SystemTesting/TestHelpers/ScreenshotHelper.html index b416aa8624..236425c047 100644 --- a/src/7.1/classes/ActionDispatch/SystemTesting/TestHelpers/ScreenshotHelper.html +++ b/src/7.1/classes/ActionDispatch/SystemTesting/TestHelpers/ScreenshotHelper.html @@ -78,7 +78,7 @@

    Takes a screenshot of the current page in the browser if the test failed.

    -

    take_failed_screenshot is called during system test teardown.

    +

    take_failed_screenshot is called during system test teardown.

    @@ -118,22 +118,22 @@

    Takes a screenshot of the current page in the browser.

    -

    take_screenshot can be used at any point in your system tests to take a screenshot of the current state. This can be useful for debugging or automating visual testing. You can take multiple screenshots per test to investigate changes at different points during your test. These will be named with a sequential prefix (or ‘failed’ for failing tests)

    +

    take_screenshot can be used at any point in your system tests to take a screenshot of the current state. This can be useful for debugging or automating visual testing. You can take multiple screenshots per test to investigate changes at different points during your test. These will be named with a sequential prefix (or ‘failed’ for failing tests)

    The default screenshots directory is tmp/screenshots but you can set a different one with Capybara.save_path

    You can use the html argument or set the RAILS_SYSTEM_TESTING_SCREENSHOT_HTML environment variable to save the HTML from the page that is being screenshotted so you can investigate the elements on the page at the time of the screenshot

    You can use the screenshot argument or set the RAILS_SYSTEM_TESTING_SCREENSHOT environment variable to control the output. Possible values are:

    -
    • simple (default) +
      • simple (default)

        Only displays the screenshot path. This is the default value.

        -
      • inline +
      • inline

        Display the screenshot in the terminal using the iTerm image protocol (iterm2.com/documentation-images.html).

        -
      • artifact +
      • artifact

        Display the screenshot in the terminal, using the terminal artifact format (buildkite.github.io/terminal-to-html/inline-images/).

        diff --git a/src/7.1/classes/ActionMailbox.html b/src/7.1/classes/ActionMailbox.html index f09db47c35..7168435916 100644 --- a/src/7.1/classes/ActionMailbox.html +++ b/src/7.1/classes/ActionMailbox.html @@ -81,7 +81,7 @@

        Action Mailbox

        Action Mailbox routes incoming emails to controller-like mailboxes for processing in Rails. It ships with ingresses for Mailgun, Mandrill, Postmark, and SendGrid. You can also handle inbound mails directly via the built-in Exim, Postfix, and Qmail ingresses.

        -

        The inbound emails are turned into InboundEmail records using Active Record and feature lifecycle tracking, storage of the original email on cloud storage via Active Storage, and responsible data handling with on-by-default incineration.

        +

        The inbound emails are turned into InboundEmail records using Active Record and feature lifecycle tracking, storage of the original email on cloud storage via Active Storage, and responsible data handling with on-by-default incineration.

        These inbound emails are routed asynchronously using Active Job to one or several dedicated mailboxes, which are capable of interacting directly with the rest of your domain model.

        diff --git a/src/7.1/classes/ActionMailbox/Base.html b/src/7.1/classes/ActionMailbox/Base.html index 9469fdaa38..8569010471 100644 --- a/src/7.1/classes/ActionMailbox/Base.html +++ b/src/7.1/classes/ActionMailbox/Base.html @@ -53,7 +53,7 @@

        Action Mailbox Base

        Application mailboxes need to override the process method, which is invoked by the framework after callbacks have been run. The callbacks available are: before_processing, after_processing, and around_processing. The primary use case is to ensure that certain preconditions to processing are fulfilled using before_processing callbacks.

        -

        If a precondition fails to be met, you can halt the processing using the #bounced! method, which will silently prevent any further processing, but not actually send out any bounce notice. You can also pair this behavior with the invocation of an Action Mailer class responsible for sending out an actual bounce email. This is done using the bounce_with method, which takes the mail object returned by an Action Mailer method, like so:

        +

        If a precondition fails to be met, you can halt the processing using the bounced! method, which will silently prevent any further processing, but not actually send out any bounce notice. You can also pair this behavior with the invocation of an Action Mailer class responsible for sending out an actual bounce email. This is done using the bounce_with method, which takes the mail object returned by an Action Mailer method, like so:

        class ForwardsMailbox < ApplicationMailbox
           before_processing :ensure_sender_is_a_user
        diff --git a/src/7.1/classes/ActionMailbox/InboundEmail.html b/src/7.1/classes/ActionMailbox/InboundEmail.html
        index 683ff4a975..55cc0c2794 100644
        --- a/src/7.1/classes/ActionMailbox/InboundEmail.html
        +++ b/src/7.1/classes/ActionMailbox/InboundEmail.html
        @@ -37,7 +37,7 @@ 

        -

        The InboundEmail is an Active Record that keeps a reference to the raw email stored in Active Storage and tracks the status of processing. By default, incoming emails will go through the following lifecycle:

        +

        The InboundEmail is an Active Record that keeps a reference to the raw email stored in Active Storage and tracks the status of processing. By default, incoming emails will go through the following lifecycle:

        • Pending: Just received by one of the ingress controllers and scheduled for routing.

        • @@ -45,14 +45,14 @@

        • Delivered: Successfully processed by the specific mailbox.

        • -

          Failed: An exception was raised during the specific mailbox’s execution of the #process method.

          +

          Failed: An exception was raised during the specific mailbox’s execution of the process method.

        • Bounced: Rejected processing by the specific mailbox and bounced to sender.

        -

        Once the InboundEmail has reached the status of being either delivered, failed, or bounced, it’ll count as having been #processed?. Once processed, the InboundEmail will be scheduled for automatic incineration at a later point.

        +

        Once the InboundEmail has reached the status of being either delivered, failed, or bounced, it’ll count as having been processed?. Once processed, the InboundEmail will be scheduled for automatic incineration at a later point.

        -

        When working with an InboundEmail, you’ll usually interact with the parsed version of the source, which is available as a Mail object from #mail. But you can also access the raw source directly using the #source method.

        +

        When working with an InboundEmail, you’ll usually interact with the parsed version of the source, which is available as a Mail object from mail. But you can also access the raw source directly using the source method.

        Examples:

        diff --git a/src/7.1/classes/ActionMailbox/InboundEmail/Incineratable.html b/src/7.1/classes/ActionMailbox/InboundEmail/Incineratable.html index 50b9e0a651..5bc14c0dd0 100644 --- a/src/7.1/classes/ActionMailbox/InboundEmail/Incineratable.html +++ b/src/7.1/classes/ActionMailbox/InboundEmail/Incineratable.html @@ -25,7 +25,7 @@

        -

        Ensure that the InboundEmail is automatically scheduled for later incineration if the status has been changed to processed. The later incineration will be invoked at the time specified by the ActionMailbox.incinerate_after time using the IncinerationJob.

        +

        Ensure that the InboundEmail is automatically scheduled for later incineration if the status has been changed to processed. The later incineration will be invoked at the time specified by the ActionMailbox.incinerate_after time using the IncinerationJob.

        diff --git a/src/7.1/classes/ActionMailbox/InboundEmail/Incineratable/Incineration.html b/src/7.1/classes/ActionMailbox/InboundEmail/Incineratable/Incineration.html index 8bd4e0f48b..196892f5a9 100644 --- a/src/7.1/classes/ActionMailbox/InboundEmail/Incineratable/Incineration.html +++ b/src/7.1/classes/ActionMailbox/InboundEmail/Incineratable/Incineration.html @@ -29,7 +29,7 @@

        -

        Command class for carrying out the actual incineration of the InboundMail that’s been scheduled for removal. Before the incineration – which really is just a call to #destroy! – is run, we verify that it’s both eligible (by virtue of having already been processed) and time to do so (that is, the InboundEmail was processed after the incinerate_after time).

        +

        Command class for carrying out the actual incineration of the InboundMail that’s been scheduled for removal. Before the incineration – which really is just a call to destroy! – is run, we verify that it’s both eligible (by virtue of having already been processed) and time to do so (that is, the InboundEmail was processed after the incinerate_after time).

        diff --git a/src/7.1/classes/ActionMailbox/InboundEmail/MessageId.html b/src/7.1/classes/ActionMailbox/InboundEmail/MessageId.html index 7357f7f7c4..cce33b6656 100644 --- a/src/7.1/classes/ActionMailbox/InboundEmail/MessageId.html +++ b/src/7.1/classes/ActionMailbox/InboundEmail/MessageId.html @@ -86,7 +86,7 @@

        -

        Create a new InboundEmail from the raw source of the email, which is uploaded as an Active Storage attachment called raw_email. Before the upload, extract the Message-ID from the source and set it as an attribute on the new InboundEmail.

        +

        Create a new InboundEmail from the raw source of the email, which is uploaded as an Active Storage attachment called raw_email. Before the upload, extract the Message-ID from the source and set it as an attribute on the new InboundEmail.

        diff --git a/src/7.1/classes/ActionMailbox/InboundEmail/Routable.html b/src/7.1/classes/ActionMailbox/InboundEmail/Routable.html index 78d35dbca8..00a274b5dc 100644 --- a/src/7.1/classes/ActionMailbox/InboundEmail/Routable.html +++ b/src/7.1/classes/ActionMailbox/InboundEmail/Routable.html @@ -23,9 +23,9 @@

        -

        A newly received InboundEmail will not be routed synchronously as part of ingress controller’s receival. Instead, the routing will be done asynchronously, using a RoutingJob, to ensure maximum parallel capacity.

        +

        A newly received InboundEmail will not be routed synchronously as part of ingress controller’s receival. Instead, the routing will be done asynchronously, using a RoutingJob, to ensure maximum parallel capacity.

        -

        By default, all newly created InboundEmail records that have the status of pending, which is the default, will be scheduled for automatic, deferred routing.

        +

        By default, all newly created InboundEmail records that have the status of pending, which is the default, will be scheduled for automatic, deferred routing.

        @@ -78,7 +78,7 @@

        -

        Route this InboundEmail using the routing rules declared on the ApplicationMailbox.

        +

        Route this InboundEmail using the routing rules declared on the ApplicationMailbox.

        @@ -113,7 +113,7 @@

        -

        Enqueue a RoutingJob for this InboundEmail.

        +

        Enqueue a RoutingJob for this InboundEmail.

        diff --git a/src/7.1/classes/ActionMailbox/IncinerationJob.html b/src/7.1/classes/ActionMailbox/IncinerationJob.html index 8133cfc223..a1376dcf57 100644 --- a/src/7.1/classes/ActionMailbox/IncinerationJob.html +++ b/src/7.1/classes/ActionMailbox/IncinerationJob.html @@ -29,9 +29,9 @@

        -

        You can configure when this IncinerationJob will be run as a time-after-processing using the config.action_mailbox.incinerate_after or ActionMailbox.incinerate_after setting.

        +

        You can configure when this IncinerationJob will be run as a time-after-processing using the config.action_mailbox.incinerate_after or ActionMailbox.incinerate_after setting.

        -

        Since this incineration is set for the future, it’ll automatically ignore any InboundEmails that have already been deleted and discard itself if so.

        +

        Since this incineration is set for the future, it’ll automatically ignore any InboundEmails that have already been deleted and discard itself if so.

        You can disable incinerating processed emails by setting config.action_mailbox.incinerate or ActionMailbox.incinerate to false.

        diff --git a/src/7.1/classes/ActionMailer/Base.html b/src/7.1/classes/ActionMailer/Base.html index 81f7452fbc..d0821ef875 100644 --- a/src/7.1/classes/ActionMailer/Base.html +++ b/src/7.1/classes/ActionMailer/Base.html @@ -40,7 +40,7 @@

        Mailer Models

        $ bin/rails generate mailer Notifier
         
        -

        The generated model inherits from ApplicationMailer which in turn inherits from ActionMailer::Base. A mailer model defines methods used to generate an email message. In these methods, you can set up variables to be used in the mailer views, options on the mail itself such as the :from address, and attachments.

        +

        The generated model inherits from ApplicationMailer which in turn inherits from ActionMailer::Base. A mailer model defines methods used to generate an email message. In these methods, you can set up variables to be used in the mailer views, options on the mail itself such as the :from address, and attachments.

        class ApplicationMailer < ActionMailer::Base
           default from: 'from@example.com'
        @@ -72,7 +72,7 @@ 

        Mailer Models

        mail - Allows you to specify email to be sent.

      -

      The hash passed to the mail method allows you to specify any header that a Mail::Message will accept (any valid email header including optional fields).

      +

      The hash passed to the mail method allows you to specify any header that a Mail::Message will accept (any valid email header including optional fields).

      The mail method, if not passed a block, will inspect your views and send all the views with the same name as the method, so the above action would send the welcome.text.erb view file as well as the welcome.html.erb view file in a multipart/alternative email.

      @@ -160,7 +160,7 @@

      Sending mail

      mail.deliver_now # generates and sends the email now
      -

      The ActionMailer::MessageDelivery class is a wrapper around a delegate that will call your method to generate the mail. If you want direct access to the delegator, or Mail::Message, you can call the message method on the ActionMailer::MessageDelivery object.

      +

      The ActionMailer::MessageDelivery class is a wrapper around a delegate that will call your method to generate the mail. If you want direct access to the delegator, or Mail::Message, you can call the message method on the ActionMailer::MessageDelivery object.

      NotifierMailer.welcome(User.first).message     # => a Mail::Message object
       
      @@ -262,7 +262,7 @@

      Observi

      An observer class must implement the :delivered_email(message) method which will be called once for every email sent after the email has been sent.

      -

      An interceptor class must implement the :delivering_email(message) method which will be called before the email is sent, allowing you to make modifications to the email before it hits the delivery agents. Your class should make any needed modifications directly to the passed in Mail::Message instance.

      +

      An interceptor class must implement the :delivering_email(message) method which will be called before the email is sent, allowing you to make modifications to the email before it hits the delivery agents. Your class should make any needed modifications directly to the passed in Mail::Message instance.

      Default Hash

      @@ -273,7 +273,7 @@

      Default Hash

      end
      -

      You can pass in any header value that a Mail::Message accepts. Out of the box, ActionMailer::Base sets the following:

      +

      You can pass in any header value that a Mail::Message accepts. Out of the box, ActionMailer::Base sets the following:

      • mime_version: "1.0"

      • @@ -284,7 +284,7 @@

        Default Hash

        parts_order: [ "text/plain", "text/enriched", "text/html" ]

      -

      parts_order and charset are not actually valid Mail::Message header fields, but Action Mailer translates them appropriately and sets the correct values.

      +

      parts_order and charset are not actually valid Mail::Message header fields, but Action Mailer translates them appropriately and sets the correct values.

      As you can pass in any header, you need to either quote the header as a string, or pass it in as an underscored symbol, so the following will work:

      @@ -308,7 +308,7 @@

      Default Hash

      Note that the proc/lambda is evaluated right at the start of the mail message generation, so if you set something in the default hash using a proc, and then set the same thing inside of your mailer method, it will get overwritten by the mailer method.

      -

      It is also possible to set these default options that will be used in all mailers through the default_options= configuration in config/application.rb:

      +

      It is also possible to set these default options that will be used in all mailers through the default_options= configuration in config/application.rb:

      config.action_mailer.default_options = { from: "no-reply@example.org" }
       
      @@ -372,7 +372,7 @@

      Previewing emails

      end -

      Methods must return a Mail::Message object which can be generated by calling the mailer method without the additional deliver_now / deliver_later. The location of the mailer preview directories can be configured using the preview_paths option which has a default of test/mailers/previews:

      +

      Methods must return a Mail::Message object which can be generated by calling the mailer method without the additional deliver_now / deliver_later. The location of the mailer preview directories can be configured using the preview_paths option which has a default of test/mailers/previews:

      config.action_mailer.preview_paths << "#{Rails.root}/lib/mailer_previews"
       
      @@ -390,7 +390,7 @@

      Previewing emails

      config.action_mailer.preview_interceptors :css_inline_styler -

      Note that interceptors need to be registered both with register_interceptor and register_preview_interceptor if they should operate on both sending and previewing emails.

      +

      Note that interceptors need to be registered both with register_interceptor and register_preview_interceptor if they should operate on both sending and previewing emails.

      Configuration options

      @@ -1369,18 +1369,18 @@

      -

      Allows you to pass random and unusual headers to the new Mail::Message object which will add them to itself.

      +

      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"
       
      -

      You can also pass a hash into headers of header field names and values, which will then be set on the Mail::Message object:

      +

      You can also pass a hash into headers of header field names and values, which will then be set on the Mail::Message object:

      headers 'X-Special-Domain-Specific-Header' => "SecretValue",
               'In-Reply-To' => incoming.message_id
       
      -

      The resulting Mail::Message will have the following in its header:

      +

      The resulting Mail::Message will have the following in its header:

      X-Special-Domain-Specific-Header: SecretValue
       
      @@ -1481,7 +1481,7 @@

      When a :return_path is specified as header, that value will be used as the ‘envelope from’ address for the Mail message. Setting this is useful when you want delivery notifications sent to a different address than the one in :from. Mail will actually use the :return_path in preference to the :sender in preference to the :from field for the ‘envelope from’ value.

      -

      If you do not pass a block to the mail method, it will find all templates in the view paths using by default the mailer name and the method name that it is being called from, it will then create parts for each of these templates intelligently, making educated guesses on correct content type and sequence, and return a fully prepared Mail::Message ready to call :deliver on to send.

      +

      If you do not pass a block to the mail method, it will find all templates in the view paths using by default the mailer name and the method name that it is being called from, it will then create parts for each of these templates intelligently, making educated guesses on correct content type and sequence, and return a fully prepared Mail::Message ready to call :deliver on to send.

      For example:

      diff --git a/src/7.1/classes/ActionMailer/FormBuilder.html b/src/7.1/classes/ActionMailer/FormBuilder.html index 8c28b543f3..13b749667a 100644 --- a/src/7.1/classes/ActionMailer/FormBuilder.html +++ b/src/7.1/classes/ActionMailer/FormBuilder.html @@ -29,7 +29,7 @@

      Actio

      While emails typically will not include forms, this can be used by views that are shared between controllers and mailers.

      -

      For more information, see ActionController::FormBuilder.

      +

      For more information, see ActionController::FormBuilder.

      diff --git a/src/7.1/classes/ActionMailer/MessageDelivery.html b/src/7.1/classes/ActionMailer/MessageDelivery.html index e52196ab49..30b7f87c53 100644 --- a/src/7.1/classes/ActionMailer/MessageDelivery.html +++ b/src/7.1/classes/ActionMailer/MessageDelivery.html @@ -31,7 +31,7 @@

      Action Mailer MessageDelivery

      -

      The ActionMailer::MessageDelivery class is used by ActionMailer::Base when creating a new mailer. MessageDelivery is a wrapper (Delegator subclass) around a lazy created Mail::Message. You can get direct access to the Mail::Message, deliver the email or schedule the email to be sent through Active Job.

      +

      The ActionMailer::MessageDelivery class is used by ActionMailer::Base when creating a new mailer. MessageDelivery is a wrapper (Delegator subclass) around a lazy created Mail::Message. You can get direct access to the Mail::Message, deliver the email or schedule the email to be sent through Active Job.

      Notifier.welcome(User.first)               # an ActionMailer::MessageDelivery object
       Notifier.welcome(User.first).deliver_now   # sends the email
      @@ -106,7 +106,7 @@ 

      -

      Enqueues the email to be delivered through Active Job. When the job runs it will send the email using deliver_now.

      +

      Enqueues the email to be delivered through Active Job. When the job runs it will send the email using deliver_now.

      Notifier.welcome(User.first).deliver_later
       Notifier.welcome(User.first).deliver_later(wait: 1.hour)
      @@ -165,7 +165,7 @@ 

      -

      Enqueues the email to be delivered through Active Job. When the job runs it will send the email using deliver_now!. That means that the message will be sent bypassing checking perform_deliveries and raise_delivery_errors, so use with caution.

      +

      Enqueues the email to be delivered through Active Job. When the job runs it will send the email using deliver_now!. That means that the message will be sent bypassing checking perform_deliveries and raise_delivery_errors, so use with caution.

      Notifier.welcome(User.first).deliver_later!
       Notifier.welcome(User.first).deliver_later!(wait: 1.hour)
      diff --git a/src/7.1/classes/ActionText/Attachable.html b/src/7.1/classes/ActionText/Attachable.html
      index 896ce8af12..561bba3976 100644
      --- a/src/7.1/classes/ActionText/Attachable.html
      +++ b/src/7.1/classes/ActionText/Attachable.html
      @@ -185,7 +185,7 @@ 

      -

      Extracts the ActionText::Attachable from the attachment HTML node:

      +

      Extracts the ActionText::Attachable from the attachment HTML node:

      person = Person.create! name: "Javan"
       html = %Q(<action-text-attachment sgid="#{person.attachable_sgid}"></action-text-attachment>)
      diff --git a/src/7.1/classes/ActionText/Attribute.html b/src/7.1/classes/ActionText/Attribute.html
      index 771265fae6..a33a5efb4b 100644
      --- a/src/7.1/classes/ActionText/Attribute.html
      +++ b/src/7.1/classes/ActionText/Attribute.html
      @@ -97,7 +97,7 @@ 

      Options

      • -

        :encrypted - Pass true to encrypt the rich text attribute. The encryption will be non-deterministic. See ActiveRecord::Encryption::EncryptableRecord.encrypts. Default: false.

        +

        :encrypted - Pass true to encrypt the rich text attribute. The encryption will be non-deterministic. See ActiveRecord::Encryption::EncryptableRecord.encrypts. Default: false.

      • :strict_loading - Pass true to force strict loading. When omitted, strict_loading: will be set to the value of the strict_loading_by_default class attribute (false by default).

      diff --git a/src/7.1/classes/ActionText/Content.html b/src/7.1/classes/ActionText/Content.html index f6162a4883..d1d2b22047 100644 --- a/src/7.1/classes/ActionText/Content.html +++ b/src/7.1/classes/ActionText/Content.html @@ -31,9 +31,9 @@

      Action Text Content

      -

      The ActionText::Content class wraps an HTML fragment to add support for parsing, rendering and serialization. It can be used to extract links and attachments, convert the fragment to plain text, or serialize the fragment to the database.

      +

      The ActionText::Content class wraps an HTML fragment to add support for parsing, rendering and serialization. It can be used to extract links and attachments, convert the fragment to plain text, or serialize the fragment to the database.

      -

      The ActionText::RichText record serializes the ‘body` attribute as ActionText::Content.

      +

      The ActionText::RichText record serializes the ‘body` attribute as ActionText::Content.

      class Message < ActiveRecord::Base
         has_rich_text :content
      diff --git a/src/7.1/classes/ActionText/FixtureSet.html b/src/7.1/classes/ActionText/FixtureSet.html
      index 817b5d255b..5ef9f6f292 100644
      --- a/src/7.1/classes/ActionText/FixtureSet.html
      +++ b/src/7.1/classes/ActionText/FixtureSet.html
      @@ -118,7 +118,7 @@ 

      Examples

      title: Another Article
      -

      You can attach a mention of articles(:first) to second‘s content by embedding a call to ActionText::FixtureSet.attachment in the body: value in test/fixtures/action_text/rich_texts.yml:

      +

      You can attach a mention of articles(:first) to second‘s content by embedding a call to ActionText::FixtureSet.attachment in the body: value in test/fixtures/action_text/rich_texts.yml:

      second:
         record: second (Article)
      diff --git a/src/7.1/classes/ActionView/Helpers/AssetTagHelper.html b/src/7.1/classes/ActionView/Helpers/AssetTagHelper.html
      index 88d2b52137..98ce39050e 100644
      --- a/src/7.1/classes/ActionView/Helpers/AssetTagHelper.html
      +++ b/src/7.1/classes/ActionView/Helpers/AssetTagHelper.html
      @@ -554,7 +554,7 @@ 

      Options

      When the last parameter is a hash you can add HTML attributes using that parameter. Apart from all the HTML supported options, the following are supported:

      • -

        :image - Hash of options that are passed directly to the image_tag helper.

        +

        :image - Hash of options that are passed directly to the image_tag helper.

      Examples

      @@ -848,7 +848,7 @@

      Options

      When the last parameter is a hash you can add HTML attributes using that parameter. The following options are supported:

      • -

        :poster - Set an image (like a screenshot) to be shown before the video loads. The path is calculated like the src of image_tag.

        +

        :poster - Set an image (like a screenshot) to be shown before the video loads. The path is calculated like the src of image_tag.

      • :size - Supplied as "#{width}x#{height}" or "#{number}", so "30x45" becomes width="30" height="45", and "50" becomes width="50" height="50". :size will be ignored if the value is not in the correct format.

      • diff --git a/src/7.1/classes/ActionView/Helpers/AssetUrlHelper.html b/src/7.1/classes/ActionView/Helpers/AssetUrlHelper.html index 7c0d2e1f48..64d53203d7 100644 --- a/src/7.1/classes/ActionView/Helpers/AssetUrlHelper.html +++ b/src/7.1/classes/ActionView/Helpers/AssetUrlHelper.html @@ -328,7 +328,7 @@

        With the asset pipeline

        -

        All options passed to asset_path will be passed to compute_asset_path which is implemented by asset pipeline gems.

        +

        All options passed to asset_path will be passed to compute_asset_path which is implemented by asset pipeline gems.

        asset_path("application.js") # => "/assets/application-60aa4fdc5cea14baf5400fba1abf4f2a46a5166bad4772b1effe341570f07de9.js"
         asset_path('application.js', host: 'example.com') # => "//example.com/assets/application.js"
        @@ -337,7 +337,7 @@ 

        With the asset pipeli

        Without the asset pipeline (skip_pipeline: true)

        -

        Accepts a type option that can specify the asset’s extension. No error checking is done to verify the source passed into asset_path is valid and that the file exists on disk.

        +

        Accepts a type option that can specify the asset’s extension. No error checking is done to verify the source passed into asset_path is valid and that the file exists on disk.

        asset_path("application.js", skip_pipeline: true)                 # => "application.js"
         asset_path("filedoesnotexist.png", skip_pipeline: true)           # => "filedoesnotexist.png"
        @@ -347,7 +347,7 @@ 

        Options applying to all assets

        -

        Below lists scenarios that apply to asset_path whether or not you’re using the asset pipeline.

        +

        Below lists scenarios that apply to asset_path whether or not you’re using the asset pipeline.

        • All fully qualified URLs are returned immediately. This bypasses the asset pipeline and all other behavior described.

          @@ -449,9 +449,9 @@

          -

          Computes the full URL to an asset in the public directory. This will use asset_path internally, so most of their behaviors will be the same. If :host options is set, it overwrites global config.action_controller.asset_host setting.

          +

          Computes the full URL to an asset in the public directory. This will use asset_path internally, so most of their behaviors will be the same. If :host options is set, it overwrites global config.action_controller.asset_host setting.

          -

          All other options provided are forwarded to asset_path call.

          +

          All other options provided are forwarded to asset_path call.

          asset_url "application.js"                                 # => http://example.com/assets/application.js
           asset_url "application.js", host: "http://cdn.example.com" # => http://cdn.example.com/assets/application.js
          @@ -540,7 +540,7 @@ 

          -

          Computes the full URL to an audio asset in the public audios directory. This will use audio_path internally, so most of their behaviors will be the same. Since audio_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

          +

          Computes the full URL to an audio asset in the public audios directory. This will use audio_path internally, so most of their behaviors will be the same. Since audio_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

          audio_url "horse.wav", host: "http://stage.example.com" # => http://stage.example.com/audios/horse.wav
           
          @@ -774,7 +774,7 @@

          -

          Computes the full URL to a font asset. This will use font_path internally, so most of their behaviors will be the same. Since font_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

          +

          Computes the full URL to a font asset. This will use font_path internally, so most of their behaviors will be the same. Since font_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

          font_url "font.ttf", host: "http://stage.example.com" # => http://stage.example.com/fonts/font.ttf
           
          @@ -825,7 +825,7 @@

          image_path("http://www.example.com/img/edit.png") # => "http://www.example.com/img/edit.png"

          -

          If you have images as application resources this method may conflict with their named routes. The alias path_to_image is provided to avoid that. Rails uses the alias internally, and plugin authors are encouraged to do so.

          +

          If you have images as application resources this method may conflict with their named routes. The alias path_to_image is provided to avoid that. Rails uses the alias internally, and plugin authors are encouraged to do so.

          @@ -864,7 +864,7 @@

          -

          Computes the full URL to an image asset. This will use image_path internally, so most of their behaviors will be the same. Since image_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

          +

          Computes the full URL to an image asset. This will use image_path internally, so most of their behaviors will be the same. Since image_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

          image_url "edit.png", host: "http://stage.example.com" # => http://stage.example.com/assets/edit.png
           
          @@ -952,7 +952,7 @@

          -

          Computes the full URL to a JavaScript asset in the public javascripts directory. This will use javascript_path internally, so most of their behaviors will be the same. Since javascript_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

          +

          Computes the full URL to a JavaScript asset in the public javascripts directory. This will use javascript_path internally, so most of their behaviors will be the same. Since javascript_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

          javascript_url "js/xmlhr.js", host: "http://stage.example.com" # => http://stage.example.com/assets/js/xmlhr.js
           
          @@ -1240,7 +1240,7 @@

          -

          Computes the full URL to a stylesheet asset in the public stylesheets directory. This will use stylesheet_path internally, so most of their behaviors will be the same. Since stylesheet_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

          +

          Computes the full URL to a stylesheet asset in the public stylesheets directory. This will use stylesheet_path internally, so most of their behaviors will be the same. Since stylesheet_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

          stylesheet_url "css/style.css", host: "http://stage.example.com" # => http://stage.example.com/assets/css/style.css
           
          @@ -1503,7 +1503,7 @@

          -

          Computes the full URL to a video asset in the public videos directory. This will use video_path internally, so most of their behaviors will be the same. Since video_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

          +

          Computes the full URL to a video asset in the public videos directory. This will use video_path internally, so most of their behaviors will be the same. Since video_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

          video_url "hd.avi", host: "http://stage.example.com" # => http://stage.example.com/videos/hd.avi
           
          diff --git a/src/7.1/classes/ActionView/Helpers/AtomFeedHelper.html b/src/7.1/classes/ActionView/Helpers/AtomFeedHelper.html index 8336b269f4..a83e462706 100644 --- a/src/7.1/classes/ActionView/Helpers/AtomFeedHelper.html +++ b/src/7.1/classes/ActionView/Helpers/AtomFeedHelper.html @@ -161,7 +161,7 @@

          end

        -

        atom_feed yields an AtomFeedBuilder instance. Nested elements yield an AtomBuilder instance.

        +

        atom_feed yields an AtomFeedBuilder instance. Nested elements yield an AtomBuilder instance.

      diff --git a/src/7.1/classes/ActionView/Helpers/CacheHelper.html b/src/7.1/classes/ActionView/Helpers/CacheHelper.html index 95936159e4..996f90fe74 100644 --- a/src/7.1/classes/ActionView/Helpers/CacheHelper.html +++ b/src/7.1/classes/ActionView/Helpers/CacheHelper.html @@ -453,7 +453,7 @@

      -

      Raises UncacheableFragmentError when called from within a cache block.

      +

      Raises UncacheableFragmentError when called from within a cache block.

      Useful to denote helper methods that can’t participate in fragment caching:

      diff --git a/src/7.1/classes/ActionView/Helpers/CaptureHelper.html b/src/7.1/classes/ActionView/Helpers/CaptureHelper.html index 54931ebc3f..a3b3111581 100644 --- a/src/7.1/classes/ActionView/Helpers/CaptureHelper.html +++ b/src/7.1/classes/ActionView/Helpers/CaptureHelper.html @@ -172,9 +172,9 @@

      -

      Calling content_for stores a block of markup in an identifier for later use. In order to access this stored content in other templates, helper modules or the layout, you would pass the identifier as an argument to content_for.

      +

      Calling content_for stores a block of markup in an identifier for later use. In order to access this stored content in other templates, helper modules or the layout, you would pass the identifier as an argument to content_for.

      -

      Note: yield can still be used to retrieve the stored content, but calling yield doesn’t work in helper modules, while content_for does.

      +

      Note: yield can still be used to retrieve the stored content, but calling yield doesn’t work in helper modules, while content_for does.

      <% content_for :not_authorized do %>
         alert('You are not authorized to do that!')
      @@ -191,7 +191,7 @@ 

      <%= yield :not_authorized if current_user.nil? %>
       
      -

      content_for, however, can also be used in helper modules.

      +

      content_for, however, can also be used in helper modules.

      module StorageHelper
         def stored_content
      @@ -219,7 +219,7 @@ 

      </html>

      -

      And now, we’ll create a view that has a content_for call that creates the script identifier.

      +

      And now, we’ll create a view that has a content_for call that creates the script identifier.

      <%# This is our view %>
       Please login!
      @@ -240,7 +240,7 @@ 

      That will place script tags for your default set of JavaScript files on the page; this technique is useful if you’ll only be using these scripts in a few views.

      -

      Note that content_for concatenates (default) the blocks it is given for a particular identifier in order. For example:

      +

      Note that content_for concatenates (default) the blocks it is given for a particular identifier in order. For example:

      <% content_for :navigation do %>
         <li><%= link_to 'Home', action: 'index' %></li>
      @@ -259,7 +259,7 @@ 

      <ul><%= content_for :navigation %></ul>
       
      -

      If the flush parameter is true content_for replaces the blocks it is given. For example:

      +

      If the flush parameter is true content_for replaces the blocks it is given. For example:

      <% content_for :navigation do %>
         <li><%= link_to 'Home', action: 'index' %></li>
      @@ -282,7 +282,7 @@ 

      <% content_for :script, javascript_include_tag(:defaults) %>
       
      -

      WARNING: content_for is ignored in caches. So you shouldn’t use it for elements that will be fragment cached.

      +

      WARNING: content_for is ignored in caches. So you shouldn’t use it for elements that will be fragment cached.

      @@ -328,7 +328,7 @@

      -

      content_for? checks whether any content has been captured yet using content_for.

      +

      content_for? checks whether any content has been captured yet using content_for.

      Useful to render parts of your layout differently based on what is in your views.

      @@ -378,7 +378,7 @@

      -

      The same as content_for but when used with streaming flushes straight back to the layout. In other words, if you want to concatenate several times to the same buffer when rendering a given template, you should use content_for, if not, use provide to tell the layout to stop looking for more contents.

      +

      The same as content_for but when used with streaming flushes straight back to the layout. In other words, if you want to concatenate several times to the same buffer when rendering a given template, you should use content_for, if not, use provide to tell the layout to stop looking for more contents.

      See ActionController::Streaming for more information.

      diff --git a/src/7.1/classes/ActionView/Helpers/DateHelper.html b/src/7.1/classes/ActionView/Helpers/DateHelper.html index 232eb6ba7f..e1f517322b 100644 --- a/src/7.1/classes/ActionView/Helpers/DateHelper.html +++ b/src/7.1/classes/ActionView/Helpers/DateHelper.html @@ -27,11 +27,11 @@

      A

      The Date Helper primarily creates select/option tags for different kinds of dates and times or date and time elements. All of the select-type methods share a number of common options that are as follows:

      • -

        :prefix - overwrites the default prefix of “date” used for the select names. So specifying “birthday” would give birthday[month] instead of date[month] if passed to the select_month method.

        +

        :prefix - overwrites the default prefix of “date” used for the select names. So specifying “birthday” would give birthday[month] instead of date[month] if passed to the select_month method.

      • :include_blank - set to true if it should be possible to set an empty date.

      • -

        :discard_type - set to true if you want to discard the type part of the select name. If set to true, the select_month method would use simply “date” (which can be overwritten using :prefix) instead of date[month].

        +

        :discard_type - set to true if you want to discard the type part of the select name. If set to true, the select_month method would use simply “date” (which can be overwritten using :prefix) instead of date[month].

      @@ -757,7 +757,7 @@

      -

      Returns a select tag with options for each of the hours 0 through 23 with the current hour selected. The datetime can be either a Time or DateTime object or an integer. Override the field name using the :field_name option, ‘hour’ by default.

      +

      Returns a select tag with options for each of the hours 0 through 23 with the current hour selected. The datetime can be either a Time or DateTime object or an integer. Override the field name using the :field_name option, ‘hour’ by default.

      my_time = Time.now + 6.hours
       
      @@ -815,7 +815,7 @@ 

      -

      Returns a select tag with options for each of the minutes 0 through 59 with the current minute selected. Also can return a select tag with options by minute_step from 0 through 59 with the 00 minute selected. The datetime can be either a Time or DateTime object or an integer. Override the field name using the :field_name option, ‘minute’ by default.

      +

      Returns a select tag with options for each of the minutes 0 through 59 with the current minute selected. Also can return a select tag with options by minute_step from 0 through 59 with the 00 minute selected. The datetime can be either a Time or DateTime object or an integer. Override the field name using the :field_name option, ‘minute’ by default.

      my_time = Time.now + 10.minutes
       
      @@ -935,7 +935,7 @@ 

      -

      Returns a select tag with options for each of the seconds 0 through 59 with the current second selected. The datetime can be either a Time or DateTime object or an integer. Override the field name using the :field_name option, ‘second’ by default.

      +

      Returns a select tag with options for each of the seconds 0 through 59 with the current second selected. The datetime can be either a Time or DateTime object or an integer. Override the field name using the :field_name option, ‘second’ by default.

      my_time = Time.now + 16.seconds
       
      @@ -1112,7 +1112,7 @@ 

      -

      Like distance_of_time_in_words, but where to_time is fixed to Time.now.

      +

      Like distance_of_time_in_words, but where to_time is fixed to Time.now.

      time_ago_in_words(3.minutes.from_now)                 # => 3 minutes
       time_ago_in_words(3.minutes.ago)                      # => 3 minutes
      @@ -1127,7 +1127,7 @@ 

      time_ago_in_words(from_time) # => 3 days

      -

      Note that you cannot pass a Numeric value to time_ago_in_words.

      +

      Note that you cannot pass a Numeric value to time_ago_in_words.

      @@ -1168,7 +1168,7 @@

      Returns a set of select tags (one for hour, minute, and optionally second) pre-selected for accessing a specified time-based attribute (identified by method) on an object assigned to the template (identified by object). You can include the seconds with :include_seconds. You can get hours in the AM/PM format with :ampm option.

      -

      This method will also generate 3 input hidden tags, for the actual year, month, and day unless the option :ignore_date is set to true. If you set the :ignore_date to true, you must have a date_select on the same method within the form otherwise an exception will be raised.

      +

      This method will also generate 3 input hidden tags, for the actual year, month, and day unless the option :ignore_date is set to true. If you set the :ignore_date to true, you must have a date_select on the same method within the form otherwise an exception will be raised.

      If anything is passed in the html_options hash it will be applied to every select tag in the set.

      diff --git a/src/7.1/classes/ActionView/Helpers/FormBuilder.html b/src/7.1/classes/ActionView/Helpers/FormBuilder.html index 58f7cd4047..5d1c6fbf4b 100644 --- a/src/7.1/classes/ActionView/Helpers/FormBuilder.html +++ b/src/7.1/classes/ActionView/Helpers/FormBuilder.html @@ -37,7 +37,7 @@

      Action View Form Builder

      -

      A FormBuilder object is associated with a particular model object and allows you to generate fields associated with the model object. The FormBuilder object is yielded when using form_for or fields_for. For example:

      +

      A FormBuilder object is associated with a particular model object and allows you to generate fields associated with the model object. The FormBuilder object is yielded when using form_for or fields_for. For example:

      <%= form_for @person do |person_form| %>
         Name: <%= person_form.text_field :name %>
      @@ -45,9 +45,9 @@ 

      A <% end %>

      -

      In the above block, a FormBuilder object is yielded as the person_form variable. This allows you to generate the text_field and check_box fields by specifying their eponymous methods, which modify the underlying template and associates the @person model object with the form.

      +

      In the above block, a FormBuilder object is yielded as the person_form variable. This allows you to generate the text_field and check_box fields by specifying their eponymous methods, which modify the underlying template and associates the @person model object with the form.

      -

      The FormBuilder object can be thought of as serving as a proxy for the methods in the FormHelper module. This class, however, allows you to call methods with the model object you are building the form for.

      +

      The FormBuilder object can be thought of as serving as a proxy for the methods in the FormHelper module. This class, however, allows you to call methods with the model object you are building the form for.

      You can create your own custom FormBuilder templates by subclassing this class. For example:

      @@ -1006,7 +1006,7 @@

      Generate an HTML id attribute value for the given field

      -

      Return the value generated by the FormBuilder for the given attribute name.

      +

      Return the value generated by the FormBuilder for the given attribute name.

      <%= form_for @post do |f| %>
         <%= f.label :title %>
      @@ -1015,7 +1015,7 @@ 

      <% end %>

      -

      In the example above, the <input type="text"> element built by the call to FormBuilder#text_field declares an aria-describedby attribute referencing the <span> element, sharing a common id root (post_title, in this case).

      +

      In the example above, the <input type="text"> element built by the call to FormBuilder#text_field declares an aria-describedby attribute referencing the <span> element, sharing a common id root (post_title, in this case).

      @@ -1052,7 +1052,7 @@

      Generate an HTML name attribute value for the given name and field combination

      -

      Return the value generated by the FormBuilder for the given attribute name.

      +

      Return the value generated by the FormBuilder for the given attribute name.

      <%= form_for @post do |f| %>
         <%= f.text_field :title, name: f.field_name(:title, :subtitle) %>
      @@ -1142,7 +1142,7 @@ 

      Creates a scope around a specific model object like form_for, but doesn’t create the form tags themselves. This makes fields_for suitable for specifying additional model objects in the same form.

      -

      Although the usage and purpose of fields_for is similar to form_for‘s, its method signature is slightly different. Like form_for, it yields a FormBuilder object associated with a particular model object to a block, and within the block allows methods to be called on the builder to generate fields associated with the model object. Fields may reflect a model object in two ways - how they are named (hence how submitted values appear within the params hash in the controller) and what default values are shown when the form the fields appear in is first displayed. In order for both of these features to be specified independently, both an object name (represented by either a symbol or string) and the object itself can be passed to the method separately -

      +

      Although the usage and purpose of fields_for is similar to form_for‘s, its method signature is slightly different. Like form_for, it yields a FormBuilder object associated with a particular model object to a block, and within the block allows methods to be called on the builder to generate fields associated with the model object. Fields may reflect a model object in two ways - how they are named (hence how submitted values appear within the params hash in the controller) and what default values are shown when the form the fields appear in is first displayed. In order for both of these features to be specified independently, both an object name (represented by either a symbol or string) and the object itself can be passed to the method separately -

      <%= form_for @person do |person_form| %>
         First name: <%= person_form.text_field :first_name %>
      @@ -1158,7 +1158,7 @@ 

      In this case, the checkbox field will be represented by an HTML input tag with the name attribute permission[admin], and the submitted value will appear in the controller as params[:permission][:admin]. If @person.permission is an existing record with an attribute admin, the initial state of the checkbox when first displayed will reflect the value of @person.permission.admin.

      -

      Often this can be simplified by passing just the name of the model object to fields_for -

      +

      Often this can be simplified by passing just the name of the model object to fields_for -

      <%= fields_for :permission do |permission_fields| %>
         Admin?: <%= permission_fields.check_box :admin %>
      @@ -1167,18 +1167,18 @@ 

      …in which case, if :permission also happens to be the name of an instance variable @permission, the initial state of the input field will reflect the value of that variable’s attribute @permission.admin.

      -

      Alternatively, you can pass just the model object itself (if the first argument isn’t a string or symbol fields_for will realize that the name has been omitted) -

      +

      Alternatively, you can pass just the model object itself (if the first argument isn’t a string or symbol fields_for will realize that the name has been omitted) -

      <%= fields_for @person.permission do |permission_fields| %>
         Admin?: <%= permission_fields.check_box :admin %>
       <% end %>
       
      -

      and fields_for will derive the required name of the field from the class of the model object, e.g. if @person.permission, is of class Permission, the field will still be named permission[admin].

      +

      and fields_for will derive the required name of the field from the class of the model object, e.g. if @person.permission, is of class Permission, the field will still be named permission[admin].

      Note: This also works for the methods in FormOptionsHelper and DateHelper that are designed to work with an object as base, like FormOptionsHelper#collection_select and DateHelper#datetime_select.

      -

      fields_for tries to be smart about parameters, but it can be confused if both name and value parameters are provided and the provided value has the shape of an option Hash. To remove the ambiguity, explicitly pass an option Hash, even if empty.

      +

      fields_for tries to be smart about parameters, but it can be confused if both name and value parameters are provided and the provided value has the shape of an option Hash. To remove the ambiguity, explicitly pass an option Hash, even if empty.

      <%= form_for @person do |person_form| %>
         ...
      diff --git a/src/7.1/classes/ActionView/Helpers/FormHelper.html b/src/7.1/classes/ActionView/Helpers/FormHelper.html
      index 21afbac367..b9046ef307 100644
      --- a/src/7.1/classes/ActionView/Helpers/FormHelper.html
      +++ b/src/7.1/classes/ActionView/Helpers/FormHelper.html
      @@ -31,9 +31,9 @@ 

      A

      Typically, a form designed to create or update a resource reflects the identity of the resource in several ways: (i) the URL that the form is sent to (the form element’s action attribute) should result in a request being routed to the appropriate controller action (with the appropriate :id parameter in the case of an existing resource), (ii) input fields should be named in such a way that in the controller their values appear in the appropriate places within the params hash, and (iii) for an existing record, when the form is initially displayed, input fields corresponding to attributes of the resource should show the current values of those attributes.

      -

      In Rails, this is usually achieved by creating the form using form_for and a number of related helper methods. form_for generates an appropriate form tag and yields a form builder object that knows the model the form is about. Input fields are created by calling methods defined on the form builder, which means they are able to generate the appropriate names and default values corresponding to the model attributes, as well as convenient IDs, etc. Conventions in the generated field names allow controllers to receive form data nicely structured in params with no effort on your side.

      +

      In Rails, this is usually achieved by creating the form using form_for and a number of related helper methods. form_for generates an appropriate form tag and yields a form builder object that knows the model the form is about. Input fields are created by calling methods defined on the form builder, which means they are able to generate the appropriate names and default values corresponding to the model attributes, as well as convenient IDs, etc. Conventions in the generated field names allow controllers to receive form data nicely structured in params with no effort on your side.

      -

      For example, to create a new person you typically set up a new instance of Person in the PeopleController#new action, @person, and in the view template pass that object to form_for:

      +

      For example, to create a new person you typically set up a new instance of Person in the PeopleController#new action, @person, and in the view template pass that object to form_for:

      <%= form_for @person do |f| %>
         <%= f.label :first_name %>:
      @@ -597,7 +597,7 @@ 

      -

      Scopes input fields with either an explicit scope or model. Like form_with does with :scope or :model, except it doesn’t output the form tags.

      +

      Scopes input fields with either an explicit scope or model. Like form_with does with :scope or :model, except it doesn’t output the form tags.

      # Using a scope prefixes the input field names:
       <%= fields :comment do |fields| %>
      @@ -621,11 +621,11 @@ 

      <% end %>

      -

      Much like form_with a FormBuilder instance associated with the scope or model is yielded, so any generated field names are prefixed with either the passed scope or the scope inferred from the :model.

      +

      Much like form_with a FormBuilder instance associated with the scope or model is yielded, so any generated field names are prefixed with either the passed scope or the scope inferred from the :model.

      Mixing with other form helpers

      -

      While form_with uses a FormBuilder object it’s possible to mix and match the stand-alone FormHelper methods and methods from FormTagHelper:

      +

      While form_with uses a FormBuilder object it’s possible to mix and match the stand-alone FormHelper methods and methods from FormTagHelper:

      <%= fields model: @comment do |fields| %>
         <%= fields.text_field :body %>
      @@ -680,7 +680,7 @@ 

      Creates a scope around a specific model object like form_for, but doesn’t create the form tags themselves. This makes fields_for suitable for specifying additional model objects in the same form.

      -

      Although the usage and purpose of fields_for is similar to form_for‘s, its method signature is slightly different. Like form_for, it yields a FormBuilder object associated with a particular model object to a block, and within the block allows methods to be called on the builder to generate fields associated with the model object. Fields may reflect a model object in two ways - how they are named (hence how submitted values appear within the params hash in the controller) and what default values are shown when the form the fields appear in is first displayed. In order for both of these features to be specified independently, both an object name (represented by either a symbol or string) and the object itself can be passed to the method separately -

      +

      Although the usage and purpose of fields_for is similar to form_for‘s, its method signature is slightly different. Like form_for, it yields a FormBuilder object associated with a particular model object to a block, and within the block allows methods to be called on the builder to generate fields associated with the model object. Fields may reflect a model object in two ways - how they are named (hence how submitted values appear within the params hash in the controller) and what default values are shown when the form the fields appear in is first displayed. In order for both of these features to be specified independently, both an object name (represented by either a symbol or string) and the object itself can be passed to the method separately -

      <%= form_for @person do |person_form| %>
         First name: <%= person_form.text_field :first_name %>
      @@ -696,7 +696,7 @@ 

      In this case, the checkbox field will be represented by an HTML input tag with the name attribute permission[admin], and the submitted value will appear in the controller as params[:permission][:admin]. If @person.permission is an existing record with an attribute admin, the initial state of the checkbox when first displayed will reflect the value of @person.permission.admin.

      -

      Often this can be simplified by passing just the name of the model object to fields_for -

      +

      Often this can be simplified by passing just the name of the model object to fields_for -

      <%= fields_for :permission do |permission_fields| %>
         Admin?: <%= permission_fields.check_box :admin %>
      @@ -705,14 +705,14 @@ 

      …in which case, if :permission also happens to be the name of an instance variable @permission, the initial state of the input field will reflect the value of that variable’s attribute @permission.admin.

      -

      Alternatively, you can pass just the model object itself (if the first argument isn’t a string or symbol fields_for will realize that the name has been omitted) -

      +

      Alternatively, you can pass just the model object itself (if the first argument isn’t a string or symbol fields_for will realize that the name has been omitted) -

      <%= fields_for @person.permission do |permission_fields| %>
         Admin?: <%= permission_fields.check_box :admin %>
       <% end %>
       
      -

      and fields_for will derive the required name of the field from the class of the model object, e.g. if @person.permission, is of class Permission, the field will still be named permission[admin].

      +

      and fields_for will derive the required name of the field from the class of the model object, e.g. if @person.permission, is of class Permission, the field will still be named permission[admin].

      Note: This also works for the methods in FormOptionsHelper and DateHelper that are designed to work with an object as base, like FormOptionsHelper#collection_select and DateHelper#datetime_select.

      @@ -913,7 +913,7 @@

      Returns a file upload input tag tailored for accessing a specified attribute (identified by method) on an object assigned to the template (identified by object). Additional options on the input tag can be passed as a hash with options. These options will be tagged onto the HTML as an HTML element attribute as in the example shown.

      -

      Using this method inside a form_for block will set the enclosing form’s encoding to multipart/form-data.

      +

      Using this method inside a form_for block will set the enclosing form’s encoding to multipart/form-data.

      Options

      • @@ -983,7 +983,7 @@

        Creates a form that allows the user to create or update the attributes of a specific model object.

        -

        The method can be used in several slightly different ways, depending on how much you wish to rely on Rails to infer automatically from the model how the form should be constructed. For a generic model object, a form can be created by passing form_for a string or symbol representing the object we are concerned with:

        +

        The method can be used in several slightly different ways, depending on how much you wish to rely on Rails to infer automatically from the model how the form should be constructed. For a generic model object, a form can be created by passing form_for a string or symbol representing the object we are concerned with:

        <%= form_for :person do |f| %>
           First name: <%= f.text_field :first_name %><br />
        @@ -994,7 +994,7 @@ 

        <% end %>

        -

        The variable f yielded to the block is a FormBuilder object that incorporates the knowledge about the model object represented by :person passed to form_for. Methods defined on the FormBuilder are used to generate fields bound to this model. Thus, for example,

        +

        The variable f yielded to the block is a FormBuilder object that incorporates the knowledge about the model object represented by :person passed to form_for. Methods defined on the FormBuilder are used to generate fields bound to this model. Thus, for example,

        <%= f.text_field :first_name %>
         
        @@ -1008,9 +1008,9 @@

        For fields generated in this way using the FormBuilder, if :person also happens to be the name of an instance variable @person, the default value of the field shown when the form is initially displayed (e.g. in the situation where you are editing an existing record) will be the value of the corresponding attribute of @person.

        -

        The rightmost argument to form_for is an optional hash of options -

        +

        The rightmost argument to form_for is an optional hash of options -

        • -

          :url - The URL the form is to be submitted to. This may be represented in the same way as values passed to url_for or link_to. So for example you may use a named route directly. When the model is represented by a string or symbol, as in the example above, if the :url option is not specified, by default the form will be sent back to the current URL (We will describe below an alternative resource-oriented usage of form_for in which the URL does not need to be specified explicitly).

          +

          :url - The URL the form is to be submitted to. This may be represented in the same way as values passed to url_for or link_to. So for example you may use a named route directly. When the model is represented by a string or symbol, as in the example above, if the :url option is not specified, by default the form will be sent back to the current URL (We will describe below an alternative resource-oriented usage of form_for in which the URL does not need to be specified explicitly).

        • :namespace - A namespace for your form to ensure uniqueness of id attributes on form elements. The namespace attribute will be prefixed with underscore on the generated HTML id.

        • @@ -1025,7 +1025,7 @@

          :html - Optional HTML attributes for the form tag.

        -

        Also note that form_for doesn’t create an exclusive scope. It’s still possible to use both the stand-alone FormHelper methods and methods from FormTagHelper. For example:

        +

        Also note that form_for doesn’t create an exclusive scope. It’s still possible to use both the stand-alone FormHelper methods and methods from FormTagHelper. For example:

        <%= form_for :person do |f| %>
           First name: <%= f.text_field :first_name %>
        @@ -1040,7 +1040,7 @@ 

        form_for with a model object

        -

        In the examples above, the object to be created or edited was represented by a symbol passed to form_for, and we noted that a string can also be used equivalently. It is also possible, however, to pass a model object itself to form_for. For example, if @post is an existing record you wish to edit, you can create the form using

        +

        In the examples above, the object to be created or edited was represented by a symbol passed to form_for, and we noted that a string can also be used equivalently. It is also possible, however, to pass a model object itself to form_for. For example, if @post is an existing record you wish to edit, you can create the form using

        <%= form_for @post do |f| %>
           ...
        @@ -1056,7 +1056,7 @@ 

        form_for, regardless of whether the object is an instance variable. So, for example, if we had a local variable post representing an existing record,

        <%= form_for post do |f| %>
           ...
        @@ -1067,7 +1067,7 @@ 

        Resource-oriented style

        -

        In the examples just shown, although not indicated explicitly, we still need to use the :url option in order to specify where the form is going to be sent. However, further simplification is possible if the record passed to form_for is a resource, i.e. it corresponds to a set of RESTful routes, e.g. defined using the resources method in config/routes.rb. In this case Rails will simply infer the appropriate URL from the record itself. For example,

        +

        In the examples just shown, although not indicated explicitly, we still need to use the :url option in order to specify where the form is going to be sent. However, further simplification is possible if the record passed to form_for is a resource, i.e. it corresponds to a set of RESTful routes, e.g. defined using the resources method in config/routes.rb. In this case Rails will simply infer the appropriate URL from the record itself. For example,

        <%= form_for @post do |f| %>
           ...
        @@ -1130,7 +1130,7 @@ 

        Resource-oriented style <% end %>

        -

        Where @document = Document.find(params[:id]) and @comment = Comment.new.

        +

        Where document = Document.find(params[:id]) and comment = Comment.new.

        Setting the method

        @@ -1372,7 +1372,7 @@

        Resource-oriented style

        -

        In many of the examples just shown, the :model passed to form_with is a resource. It corresponds to a set of RESTful routes, most likely defined via resources in config/routes.rb.

        +

        In many of the examples just shown, the :model passed to form_with is a resource. It corresponds to a set of RESTful routes, most likely defined via resources in config/routes.rb.

        So when passing such a model record, Rails infers the URL and method.

        @@ -1402,7 +1402,7 @@

        Resource-oriented styl <% end %>

        -

        form_with options

        +

        form_with options

        • :url - The URL the form submits to. Akin to values passed to url_for or link_to. For example, you may use a named route directly. When a :scope is passed without a :url the form just submits to the current URL.

        • @@ -1435,7 +1435,7 @@

          form_with optio

          Examples

          -

          When not passing a block, form_with just generates an opening form tag.

          +

          When not passing a block, form_with just generates an opening form tag.

          <%= form_with(model: @post, url: super_posts_path) %>
           <%= form_with(model: @post, scope: :article) %>
          @@ -1457,11 +1457,11 @@ 

          Examples

          <% end %>
          -

          Where @document = Document.find(params[:id]).

          +

          Where document = Document.find(params[:id]).

          Mixing with other form helpers

          -

          While form_with uses a FormBuilder object it’s possible to mix and match the stand-alone FormHelper methods and methods from FormTagHelper:

          +

          While form_with uses a FormBuilder object it’s possible to mix and match the stand-alone FormHelper methods and methods from FormTagHelper:

          <%= form_with scope: :person do |form| %>
             <%= form.text_field :first_name %>
          @@ -1504,7 +1504,7 @@ 

          Setting HTML options

          Removing hidden model id’s

          -

          The form_with method automatically includes the model id as a hidden field in the form. This is used to maintain the correlation between the form data and its associated model. Some ORM systems do not use IDs on nested models so in this case you want to be able to disable the hidden id.

          +

          The form_with method automatically includes the model id as a hidden field in the form. This is used to maintain the correlation between the form data and its associated model. Some ORM systems do not use IDs on nested models so in this case you want to be able to disable the hidden id.

          In the following example the Post model has many Comments stored within it in a NoSQL database, thus there is no primary key for comments.

          diff --git a/src/7.1/classes/ActionView/Helpers/FormOptionsHelper.html b/src/7.1/classes/ActionView/Helpers/FormOptionsHelper.html index 27bde409d3..51bfadd4a6 100644 --- a/src/7.1/classes/ActionView/Helpers/FormOptionsHelper.html +++ b/src/7.1/classes/ActionView/Helpers/FormOptionsHelper.html @@ -27,7 +27,7 @@

          collection_select, select and time_zone_select methods take an options parameter, a hash:

          • :include_blank - set to true or a prompt string if the first option element of the select element is a blank. Useful if there is not a default value required for the select element.

            @@ -103,7 +103,7 @@

            collection_select helper, :disabled can also be a Proc that identifies those options that should be disabled.

            collection_select(:post, :category_id, Category.all, :id, :name, { disabled: -> (category) { category.archived? } })
             
            @@ -591,7 +591,7 @@

            -

            Returns a string of <option> tags, like options_for_select, but wraps them with <optgroup> tags:

            +

            Returns a string of <option> tags, like options_for_select, but wraps them with <optgroup> tags:

            grouped_options = [
              ['North America',
            @@ -623,7 +623,7 @@ 

            Parameters:

            • -

              grouped_options - Accepts a nested array or hash of strings. The first value serves as the <optgroup> label while the second value must be an array of options. The second value can be a nested array of text-value pairs. See options_for_select for more info.

              +

              grouped_options - Accepts a nested array or hash of strings. The first value serves as the <optgroup> label while the second value must be an array of options. The second value can be a nested array of text-value pairs. See options_for_select for more info.

              Ex. ["North America",[["United States","US"],["Canada","CA"]]]
               
              @@ -720,7 +720,7 @@

              -

              Returns a string of <option> tags, like options_from_collection_for_select, but groups them by <optgroup> tags based on the object relationships of the arguments.

              +

              Returns a string of <option> tags, like options_from_collection_for_select, but groups them by <optgroup> tags based on the object relationships of the arguments.

              Parameters:

              • @@ -988,9 +988,9 @@

                There are two possible formats for the choices parameter, corresponding to other helpers’ output:

                Example with @post.person_id => 2:

                @@ -1129,7 +1129,7 @@

                Returns select and option tags for the given object and method, using time_zone_options_for_select to generate the list of option tags.

                -

                In addition to the :include_blank option documented above, this method also supports a :model option, which defaults to ActiveSupport::TimeZone. This may be used by users to specify a different time zone model object. (See time_zone_options_for_select for more information.)

                +

                In addition to the :include_blank option documented above, this method also supports a :model option, which defaults to ActiveSupport::TimeZone. This may be used by users to specify a different time zone model object. (See time_zone_options_for_select for more information.)

                You can also supply an array of ActiveSupport::TimeZone objects as priority_zones so that they will be listed above the rest of the (long) list. You can use ActiveSupport::TimeZone.us_zones for a list of US time zones, ActiveSupport::TimeZone.country_zones(country_code) for another country’s time zones, or a Regexp to select the zones of your choice.

                @@ -1231,7 +1231,7 @@

                -

                Returns select and option tags for the given object and method, using weekday_options_for_select to generate the list of option tags.

                +

                Returns select and option tags for the given object and method, using weekday_options_for_select to generate the list of option tags.

                diff --git a/src/7.1/classes/ActionView/Helpers/FormTagHelper.html b/src/7.1/classes/ActionView/Helpers/FormTagHelper.html index b8712a615f..1ff6b74a90 100644 --- a/src/7.1/classes/ActionView/Helpers/FormTagHelper.html +++ b/src/7.1/classes/ActionView/Helpers/FormTagHelper.html @@ -630,7 +630,7 @@

                Generate an HTML id attribute value for the given name and field combination

                -

                Return the value generated by the FormBuilder for the given attribute name.

                +

                Return the value generated by the FormBuilder for the given attribute name.

                <%= label_tag :post, :title %>
                 <%= text_field :post, :title, aria: { describedby: field_id(:post, :title, :error) } %>
                @@ -688,7 +688,7 @@ 

                Generate an HTML name attribute value for the given name and field combination

                -

                Return the value generated by the FormBuilder for the given attribute name.

                +

                Return the value generated by the FormBuilder for the given attribute name.

                <%= text_field :post, :title, name: field_name(:post, :title, :subtitle) %>
                 <%# => <input type="text" name="post[title][subtitle]"> %>
                diff --git a/src/7.1/classes/ActionView/Helpers/SanitizeHelper.html b/src/7.1/classes/ActionView/Helpers/SanitizeHelper.html
                index 4db395a9b7..a05cba5a66 100644
                --- a/src/7.1/classes/ActionView/Helpers/SanitizeHelper.html
                +++ b/src/7.1/classes/ActionView/Helpers/SanitizeHelper.html
                @@ -97,13 +97,13 @@ 

                Please note that sanitizing user-provided text does not guarantee that the resulting markup is valid or even well-formed.

                Options

                -
                :tags +
                :tags

                An array of allowed tags.

                -
                :attributes +
                :attributes

                An array of allowed attributes.

                -
                :scrubber +
                :scrubber

                A Rails::HTML scrubber or Loofah::Scrubber object that defines custom sanitization rules. A custom scrubber takes precedence over custom tags and attributes.

                diff --git a/src/7.1/classes/ActionView/Helpers/TextHelper.html b/src/7.1/classes/ActionView/Helpers/TextHelper.html index 2f7c3e4fbc..bf09b21a63 100644 --- a/src/7.1/classes/ActionView/Helpers/TextHelper.html +++ b/src/7.1/classes/ActionView/Helpers/TextHelper.html @@ -29,7 +29,7 @@

                A

                Sanitization

                -

                Most text helpers that generate HTML output sanitize the given input by default, but do not escape it. This means HTML tags will appear in the page but all malicious code will be removed. Let’s look at some examples using the simple_format method:

                +

                Most text helpers that generate HTML output sanitize the given input by default, but do not escape it. This means HTML tags will appear in the page but all malicious code will be removed. Let’s look at some examples using the simple_format method:

                simple_format('<a href="http://example.com/">Example</a>')
                 # => "<p><a href=\"http://example.com/\">Example</a></p>"
                @@ -334,13 +334,13 @@ 

                Extracts the first occurrence of phrase plus surrounding text from text. An omission marker is prepended / appended if the start / end of the result does not coincide with the start / end of text. The result is always stripped in any case. Returns nil if phrase isn’t found.

                Options

                -
                :radius +
                :radius

                The number of characters (or tokens — see :separator option) around phrase to include in the result. Defaults to 100.

                -
                :omission +
                :omission

                The marker to prepend / append when the start / end of the excerpt does not coincide with the start / end of text. Defaults to "...".

                -
                :separator +
                :separator

                The separator between tokens to count for :radius. Defaults to "", which treats each character as a token.

                @@ -432,10 +432,10 @@

                If a block is specified, it will be used instead of the highlighter string. Each occurrence of a phrase will be passed to the block, and its return value will be inserted into the final result.

                Options

                -
                :highlighter +
                :highlighter

                The highlighter string. Uses \1 as the placeholder for a phrase, similar to +String#sub+. Defaults to "<mark>\1</mark>". This option is ignored if a block is specified.

                -
                :sanitize +
                :sanitize

                Whether to sanitize text before highlighting. Defaults to true.

                @@ -754,16 +754,16 @@

                The result will be escaped unless escape: false is specified. In any case, the result will be marked HTML-safe. Care should be taken if text might contain HTML tags or entities, because truncation could produce invalid HTML, such as unbalanced or incomplete tags.

                Options

                -
                :length +
                :length

                The maximum number of characters that should be returned, excluding any extra content from the block. Defaults to 30.

                -
                :omission +
                :omission

                The string to append after truncating. Defaults to "...".

                -
                :separator +
                :separator

                A string or regexp used to find a breaking point at which to truncate. By default, truncation can occur at any character in text.

                -
                :escape +
                :escape

                Whether to escape the result. Defaults to true.

                diff --git a/src/7.1/classes/ActionView/Helpers/UrlHelper.html b/src/7.1/classes/ActionView/Helpers/UrlHelper.html index cdeaa091cd..645a433045 100644 --- a/src/7.1/classes/ActionView/Helpers/UrlHelper.html +++ b/src/7.1/classes/ActionView/Helpers/UrlHelper.html @@ -216,7 +216,7 @@

                The form submits a POST request by default. You can specify a different HTTP verb via the :method option within html_options.

                -

                If the HTML button generated from button_to does not work with your layout, you can consider using the link_to method with the data-turbo-method attribute as described in the link_to documentation.

                +

                If the HTML button generated from button_to does not work with your layout, you can consider using the link_to method with the data-turbo-method attribute as described in the link_to documentation.

                Options

                @@ -536,7 +536,7 @@ -

                Because it relies on url_for, link_to supports both older-style controller/action/id arguments and newer RESTful routes. Current Rails style favors RESTful routes whenever possible, so base your application on resources and use

                +

                Because it relies on url_for, link_to supports both older-style controller/action/id arguments and newer RESTful routes. Current Rails style favors RESTful routes whenever possible, so base your application on resources and use

                link_to "Profile", profile_path(@profile)
                 # => <a href="/profiles/1">Profile</a>
                @@ -606,7 +606,7 @@ 
                 # => <a href="/articles/index/news?class=article">WRONG!</a>
                 
                -

                link_to can also produce links with anchors or query strings:

                +

                link_to can also produce links with anchors or query strings:

                link_to "Comment wall", profile_path(@profile, anchor: "wall")
                 # => <a href="/profiles/1#wall">Comment wall</a>
                @@ -710,7 +710,7 @@ 
                -

                The implicit block given to link_to_unless_current is evaluated if the current action is the action given. So, if we had a comments page and wanted to render a “Go Back” link instead of a link to the comments page, we could do something like this…

                +

                The implicit block given to link_to_unless_current is evaluated if the current action is the action given. So, if we had a comments page and wanted to render a “Go Back” link instead of a link to the comments page, we could do something like this…

                <%=
                     link_to_unless_current("Comment", { controller: "comments", action: "new" }) do
                @@ -894,7 +894,7 @@ 

                Creates a mailto link tag to the specified email_address, which is also used as the name of the link unless name is specified. Additional HTML attributes for the link can be passed in html_options.

                -

                mail_to has several methods for customizing the email itself by passing special keys to html_options.

                +

                mail_to has several methods for customizing the email itself by passing special keys to html_options.

                Options

                • @@ -911,7 +911,7 @@

                  Options

                  Obfuscation

                  -

                  Prior to Rails 4.0, mail_to provided options for encoding the address in order to hinder email harvesters. To take advantage of these options, install the actionview-encoded_mail_to gem.

                  +

                  Prior to Rails 4.0, mail_to provided options for encoding the address in order to hinder email harvesters. To take advantage of these options, install the actionview-encoded_mail_to gem.

                  Examples

                  diff --git a/src/7.1/classes/ActionView/Layouts/ClassMethods.html b/src/7.1/classes/ActionView/Layouts/ClassMethods.html index 2b7e1d3c29..950485ef7d 100644 --- a/src/7.1/classes/ActionView/Layouts/ClassMethods.html +++ b/src/7.1/classes/ActionView/Layouts/ClassMethods.html @@ -69,27 +69,27 @@

                  Specify the layout to use for this class.

                  If the specified layout is a:

                  -
                  String +
                  String

                  the String is the template name

                  -
                  Symbol +
                  Symbol

                  call the method specified by the symbol

                  -
                  Proc +
                  Proc

                  call the passed Proc

                  -
                  false +
                  false

                  There is no layout

                  -
                  true +
                  true

                  raise an ArgumentError

                  -
                  nil +
                  nil

                  Force default layout behavior with inheritance

                  -

                  Return value of Proc and Symbol arguments should be String, false, true, or nil with the same meaning as described above.

                  +

                  Return value of Proc and Symbol arguments should be String, false, true, or nil with the same meaning as described above.

                  Parameters

                  • diff --git a/src/7.1/classes/ActionView/Renderer.html b/src/7.1/classes/ActionView/Renderer.html index 22bb8fa6c1..dc25b2dfbf 100644 --- a/src/7.1/classes/ActionView/Renderer.html +++ b/src/7.1/classes/ActionView/Renderer.html @@ -33,7 +33,7 @@

                    Action View Rende

                    This is the main entry point for rendering. It basically delegates to other objects like TemplateRenderer and PartialRenderer which actually renders the template.

                    -

                    The Renderer will parse the options from the render or render_body method and render a partial or a template based on the options. The TemplateRenderer and PartialRenderer objects are wrappers which do all the setup and logic necessary to render a view and a new object is created each time render is called.

                    +

                    The Renderer will parse the options from the render or render_body method and render a partial or a template based on the options. The TemplateRenderer and PartialRenderer objects are wrappers which do all the setup and logic necessary to render a view and a new object is created each time render is called.

                diff --git a/src/7.1/classes/ActionView/RoutingUrlFor.html b/src/7.1/classes/ActionView/RoutingUrlFor.html index 02b1f772f8..0eb0329cc5 100644 --- a/src/7.1/classes/ActionView/RoutingUrlFor.html +++ b/src/7.1/classes/ActionView/RoutingUrlFor.html @@ -66,7 +66,7 @@

                -

                Returns the URL for the set of options provided. This takes the same options as url_for in Action Controller (see the documentation for ActionDispatch::Routing::UrlFor#url_for). Note that by default :only_path is true so you’ll get the relative "/controller/action" instead of the fully qualified URL like "http://example.com/controller/action".

                +

                Returns the URL for the set of options provided. This takes the same options as url_for in Action Controller (see the documentation for ActionDispatch::Routing::UrlFor#url_for). Note that by default :only_path is true so you’ll get the relative "/controller/action" instead of the fully qualified URL like "http://example.com/controller/action".

                Options

                • @@ -87,7 +87,7 @@

                  Options

                  Relying on named routes

                  -

                  Passing a record (like an Active Record) instead of a hash as the options parameter will trigger the named route for that record. The lookup will happen on the name of the class. So passing a Workshop object will attempt to use the workshop_path route. If you have a nested route, such as admin_workshop_path you’ll have to call that explicitly (it’s impossible for url_for to guess that route).

                  +

                  Passing a record (like an Active Record) instead of a hash as the options parameter will trigger the named route for that record. The lookup will happen on the name of the class. So passing a Workshop object will attempt to use the workshop_path route. If you have a nested route, such as admin_workshop_path you’ll have to call that explicitly (it’s impossible for url_for to guess that route).

                  Implicit Controller Namespacing

                  diff --git a/src/7.1/classes/ActionView/Template.html b/src/7.1/classes/ActionView/Template.html index 636a913f69..c9c264db4f 100644 --- a/src/7.1/classes/ActionView/Template.html +++ b/src/7.1/classes/ActionView/Template.html @@ -472,18 +472,18 @@

                  <%= render "application/header", { headline: "Welcome", person: person } %>
                   
                  -

                  You can use local_assigns in the sub templates to access the local variables:

                  +

                  You can use local_assigns in the sub templates to access the local variables:

                  local_assigns[:headline] # => "Welcome"
                   
                  -

                  Each key in local_assigns is available as a partial-local variable:

                  +

                  Each key in local_assigns is available as a partial-local variable:

                  local_assigns[:headline] # => "Welcome"
                   headline                 # => "Welcome"
                   
                  -

                  Since local_assigns is a Hash, it’s compatible with Ruby 3.1’s pattern matching assignment operator:

                  +

                  Since local_assigns is a Hash, it’s compatible with Ruby 3.1’s pattern matching assignment operator:

                  local_assigns => { headline:, **options }
                   headline                 # => "Welcome"
                  @@ -504,7 +504,7 @@ 

                  <% end %>

                  -

                  Since local_assigns returns a Hash instance, you can conditionally read a variable, then fall back to a default value when the key isn’t part of the locals: { ... } options:

                  +

                  Since local_assigns returns a Hash instance, you can conditionally read a variable, then fall back to a default value when the key isn’t part of the locals: { ... } options:

                  <% local_assigns.fetch(:alerts, []).each do |alert| %>
                     <p><%= alert %></p>
                  diff --git a/src/7.1/classes/ActionView/TestCase.html b/src/7.1/classes/ActionView/TestCase.html
                  index 63aa3f888b..016c1d04b2 100644
                  --- a/src/7.1/classes/ActionView/TestCase.html
                  +++ b/src/7.1/classes/ActionView/TestCase.html
                  @@ -31,7 +31,7 @@ 

                  Action View Test Case

                  -

                  Read more about ActionView::TestCase in Testing Rails Applications in the guides.

                  +

                  Read more about ActionView::TestCase in Testing Rails Applications in the guides.

                diff --git a/src/7.1/classes/ActionView/TestCase/Behavior.html b/src/7.1/classes/ActionView/TestCase/Behavior.html index 62f7f172ff..31d906258b 100644 --- a/src/7.1/classes/ActionView/TestCase/Behavior.html +++ b/src/7.1/classes/ActionView/TestCase/Behavior.html @@ -300,7 +300,7 @@

                .json

                -

                Parse the rendered content String into JSON. By default, this means a ActiveSupport::HashWithIndifferentAccess.

                +

                Parse the rendered content String into JSON. By default, this means a ActiveSupport::HashWithIndifferentAccess.

                test "renders JSON" do
                   article = Article.create!(title: "Hello, world")
                diff --git a/src/7.1/classes/ActionView/TestCase/Behavior/ClassMethods.html b/src/7.1/classes/ActionView/TestCase/Behavior/ClassMethods.html
                index b6b74cd441..5ae18364b3 100644
                --- a/src/7.1/classes/ActionView/TestCase/Behavior/ClassMethods.html
                +++ b/src/7.1/classes/ActionView/TestCase/Behavior/ClassMethods.html
                @@ -253,7 +253,7 @@ 

                Register a callable to parse rendered content for a given template format.

                -

                Each registered parser will also define a #rendered.[FORMAT] helper method, where [FORMAT] corresponds to the value of the format argument.

                +

                Each registered parser will also define a rendered.[FORMAT] helper method, where [FORMAT] corresponds to the value of the format argument.

                By default, ActionView::TestCase defines parsers for:

                • @@ -270,10 +270,10 @@

                Parameters

                -
                format +
                format
                -

                The name (as a Symbol) of the format used to render the content.

                -
                callable +

                The name (as a Symbol) of the format used to render the content.

                +
                callable

                The parser. A callable object that accepts the rendered string as its sole argument. Alternatively, the parser can be specified as a block.

                diff --git a/src/7.1/classes/ActiveJob/Enqueuing/ClassMethods.html b/src/7.1/classes/ActiveJob/Enqueuing/ClassMethods.html index 7b0461f20a..7d6d0e49b7 100644 --- a/src/7.1/classes/ActiveJob/Enqueuing/ClassMethods.html +++ b/src/7.1/classes/ActiveJob/Enqueuing/ClassMethods.html @@ -23,7 +23,7 @@

                -

                Includes the perform_later method for job initialization.

                +

                Includes the perform_later method for job initialization.

                diff --git a/src/7.1/classes/ActiveJob/Execution.html b/src/7.1/classes/ActiveJob/Execution.html index 610f111869..7a623f344b 100644 --- a/src/7.1/classes/ActiveJob/Execution.html +++ b/src/7.1/classes/ActiveJob/Execution.html @@ -140,7 +140,7 @@

                -

                Performs the job immediately. The job is not sent to the queuing adapter but directly executed by blocking the execution of others until it’s finished. perform_now returns the value of your job’s perform method.

                +

                Performs the job immediately. The job is not sent to the queuing adapter but directly executed by blocking the execution of others until it’s finished. perform_now returns the value of your job’s perform method.

                class MyJob < ActiveJob::Base
                   def perform
                diff --git a/src/7.1/classes/ActiveJob/QueueAdapters/QueueClassicAdapter.html b/src/7.1/classes/ActiveJob/QueueAdapters/QueueClassicAdapter.html
                index 298fdd3b74..8b731a71ab 100644
                --- a/src/7.1/classes/ActiveJob/QueueAdapters/QueueClassicAdapter.html
                +++ b/src/7.1/classes/ActiveJob/QueueAdapters/QueueClassicAdapter.html
                @@ -89,7 +89,7 @@ 

                Builds a QC::Queue object to schedule jobs on.

                -

                If you have a custom QC::Queue subclass you’ll need to subclass ActiveJob::QueueAdapters::QueueClassicAdapter and override the build_queue method.

                +

                If you have a custom QC::Queue subclass you’ll need to subclass ActiveJob::QueueAdapters::QueueClassicAdapter and override the build_queue method.

                diff --git a/src/7.1/classes/ActiveJob/TestHelper.html b/src/7.1/classes/ActiveJob/TestHelper.html index dc9fbd2737..4fa9b6f803 100644 --- a/src/7.1/classes/ActiveJob/TestHelper.html +++ b/src/7.1/classes/ActiveJob/TestHelper.html @@ -537,7 +537,7 @@

                -

                Asserts that the number of performed jobs matches the given number. If no block is passed, perform_enqueued_jobs must be called around or after the job call.

                +

                Asserts that the number of performed jobs matches the given number. If no block is passed, perform_enqueued_jobs must be called around or after the job call.

                def test_jobs
                   assert_performed_jobs 0
                @@ -859,7 +859,7 @@ 

                If the :at option is specified, then only jobs that have been enqueued to run at or before the given time will be performed. This includes jobs that have been enqueued without a time.

                -

                If queue_adapter_for_test is overridden to return a different adapter, perform_enqueued_jobs will merely execute the block.

                +

                If queue_adapter_for_test is overridden to return a different adapter, perform_enqueued_jobs will merely execute the block.

                diff --git a/src/7.1/classes/ActiveModel.html b/src/7.1/classes/ActiveModel.html index 13cebb8062..569a320bd5 100644 --- a/src/7.1/classes/ActiveModel.html +++ b/src/7.1/classes/ActiveModel.html @@ -197,7 +197,7 @@

                Act

                You can read more about Active Model in the Active Model Basics guide.

                -

                Prior to Rails 3.0, if a plugin or gem developer wanted to have an object interact with Action Pack helpers, it was required to either copy chunks of code from Rails, or monkey patch entire helpers to make them handle objects that did not exactly conform to the Active Record interface. This would result in code duplication and fragile applications that broke on upgrades. Active Model solves this by defining an explicit API. You can read more about the API in ActiveModel::Lint::Tests.

                +

                Prior to Rails 3.0, if a plugin or gem developer wanted to have an object interact with Action Pack helpers, it was required to either copy chunks of code from Rails, or monkey patch entire helpers to make them handle objects that did not exactly conform to the Active Record interface. This would result in code duplication and fragile applications that broke on upgrades. Active Model solves this by defining an explicit API. You can read more about the API in ActiveModel::Lint::Tests.

                Active Model provides a default module that implements the basic API required to integrate with Action Pack out of the box: ActiveModel::API.

                diff --git a/src/7.1/classes/ActiveModel/API.html b/src/7.1/classes/ActiveModel/API.html index 0f65b4aa82..60557eb6df 100644 --- a/src/7.1/classes/ActiveModel/API.html +++ b/src/7.1/classes/ActiveModel/API.html @@ -39,7 +39,7 @@

                Active Model API

                person.age # => "18"

                -

                Note that, by default, ActiveModel::API implements persisted? to return false, which is the most common case. You may want to override it in your class to simulate a different scenario:

                +

                Note that, by default, ActiveModel::API implements persisted? to return false, which is the most common case. You may want to override it in your class to simulate a different scenario:

                class Person
                   include ActiveModel::API
                @@ -70,7 +70,7 @@ 

                Active Model API

                person.omg # => true
                -

                For more detailed information on other functionalities available, please refer to the specific modules included in ActiveModel::API (see below).

                +

                For more detailed information on other functionalities available, please refer to the specific modules included in ActiveModel::API (see below).

                diff --git a/src/7.1/classes/ActiveModel/AttributeMethods.html b/src/7.1/classes/ActiveModel/AttributeMethods.html index 8453e75240..671e9f2237 100644 --- a/src/7.1/classes/ActiveModel/AttributeMethods.html +++ b/src/7.1/classes/ActiveModel/AttributeMethods.html @@ -33,7 +33,7 @@

                ActiveRecord::Base - like class methods such as table_name.

                -

                The requirements to implement ActiveModel::AttributeMethods are to:

                +

                The requirements to implement ActiveModel::AttributeMethods are to:

                • include ActiveModel::AttributeMethods in your class.

                • @@ -176,7 +176,7 @@

                  -

                  attribute_missing is like method_missing, but for attributes. When method_missing is called we check to see if there is a matching attribute method. If so, we tell attribute_missing to dispatch the attribute. This method can be overloaded to customize the behavior.

                  +

                  attribute_missing is like method_missing, but for attributes. When method_missing is called we check to see if there is a matching attribute method. If so, we tell attribute_missing to dispatch the attribute. This method can be overloaded to customize the behavior.

                  diff --git a/src/7.1/classes/ActiveModel/AttributeMethods/ClassMethods.html b/src/7.1/classes/ActiveModel/AttributeMethods/ClassMethods.html index 8a2e6a29ff..2194f82ac5 100644 --- a/src/7.1/classes/ActiveModel/AttributeMethods/ClassMethods.html +++ b/src/7.1/classes/ActiveModel/AttributeMethods/ClassMethods.html @@ -426,9 +426,9 @@

                  -

                  Declares an attribute that should be prefixed and suffixed by ActiveModel::AttributeMethods.

                  +

                  Declares an attribute that should be prefixed and suffixed by ActiveModel::AttributeMethods.

                  -

                  To use, pass an attribute name (as string or symbol). Be sure to declare define_attribute_method after you define any prefix, suffix or affix method, or they will not hook in.

                  +

                  To use, pass an attribute name (as string or symbol). Be sure to declare define_attribute_method after you define any prefix, suffix or affix method, or they will not hook in.

                  class Person
                     include ActiveModel::AttributeMethods
                  @@ -491,9 +491,9 @@ 

                  -

                  Declares the attributes that should be prefixed and suffixed by ActiveModel::AttributeMethods.

                  +

                  Declares the attributes that should be prefixed and suffixed by ActiveModel::AttributeMethods.

                  -

                  To use, pass attribute names (as strings or symbols). Be sure to declare define_attribute_methods after you define any prefix, suffix, or affix methods, or they will not hook in.

                  +

                  To use, pass attribute names (as strings or symbols). Be sure to declare define_attribute_methods after you define any prefix, suffix, or affix methods, or they will not hook in.

                  class Person
                     include ActiveModel::AttributeMethods
                  diff --git a/src/7.1/classes/ActiveModel/Callbacks.html b/src/7.1/classes/ActiveModel/Callbacks.html
                  index 310625f92d..38185a242c 100644
                  --- a/src/7.1/classes/ActiveModel/Callbacks.html
                  +++ b/src/7.1/classes/ActiveModel/Callbacks.html
                  @@ -29,7 +29,7 @@ 

                  Active Model

                  Like the Active Record methods, the callback chain is aborted as soon as one of the methods throws :abort.

                  -

                  First, extend ActiveModel::Callbacks from the class you are creating:

                  +

                  First, extend ActiveModel::Callbacks from the class you are creating:

                  class MyModel
                     extend ActiveModel::Callbacks
                  @@ -70,7 +70,7 @@ 

                  Active Model end

                  -

                  You can choose to have only specific callbacks by passing a hash to the define_model_callbacks method.

                  +

                  You can choose to have only specific callbacks by passing a hash to the define_model_callbacks method.

                  define_model_callbacks :create, only: [:after, :before]
                   
                  @@ -140,12 +140,12 @@

                  -

                  define_model_callbacks accepts the same options define_callbacks does, in case you want to overwrite a default. Besides that, it also accepts an :only option, where you can choose if you want all types (before, around or after) or just some.

                  +

                  define_model_callbacks accepts the same options define_callbacks does, in case you want to overwrite a default. Besides that, it also accepts an :only option, where you can choose if you want all types (before, around or after) or just some.

                  define_model_callbacks :initialize, only: :after
                   
                  -

                  Note, the only: <type> hash will apply to all callbacks defined on that method call. To get around this you can call the define_model_callbacks method as many times as you need.

                  +

                  Note, the only: <type> hash will apply to all callbacks defined on that method call. To get around this you can call the define_model_callbacks method as many times as you need.

                  define_model_callbacks :create,  only: :after
                   define_model_callbacks :update,  only: :before
                  @@ -170,7 +170,7 @@ 

                  end

                  -

                  NOTE: method_name passed to define_model_callbacks must not end with !, ? or =.

                  +

                  NOTE: method_name passed to define_model_callbacks must not end with !, ? or =.

                  diff --git a/src/7.1/classes/ActiveModel/Dirty.html b/src/7.1/classes/ActiveModel/Dirty.html index 4c79156fff..18c652d65d 100644 --- a/src/7.1/classes/ActiveModel/Dirty.html +++ b/src/7.1/classes/ActiveModel/Dirty.html @@ -35,11 +35,11 @@

                  Active Model Dirty
                • Call *_will_change! before each change to the tracked attribute.

                • -

                  Call changes_applied after the changes are persisted.

                  +

                  Call changes_applied after the changes are persisted.

                • -

                  Call clear_changes_information when you want to reset the changes information.

                  +

                  Call clear_changes_information when you want to reset the changes information.

                • -

                  Call restore_attributes when you want to restore previous data.

                  +

                  Call restore_attributes when you want to restore previous data.

                A minimal implementation could be:

                @@ -808,7 +808,7 @@

                -

                Clears dirty data and moves changes to previous_changes and mutations_from_database to mutations_before_last_save respectively.

                +

                Clears dirty data and moves changes to previous_changes and mutations_from_database to mutations_before_last_save respectively.

                diff --git a/src/7.1/classes/ActiveModel/EachValidator.html b/src/7.1/classes/ActiveModel/EachValidator.html index 59cf027629..cc5664c49d 100644 --- a/src/7.1/classes/ActiveModel/EachValidator.html +++ b/src/7.1/classes/ActiveModel/EachValidator.html @@ -31,7 +31,7 @@

                Active Model EachValidator

                -

                EachValidator is a validator which iterates through the attributes given in the options hash invoking the validate_each method passing in the record, attribute, and value.

                +

                EachValidator is a validator which iterates through the attributes given in the options hash invoking the validate_each method passing in the record, attribute, and value.

                All Active Model validations are built on top of this validator.

                @@ -183,7 +183,7 @@

                -

                Performs validation on the supplied record. By default this will call validate_each to determine validity therefore subclasses should override validate_each with validation logic.

                +

                Performs validation on the supplied record. By default this will call validate_each to determine validity therefore subclasses should override validate_each with validation logic.

                diff --git a/src/7.1/classes/ActiveModel/Errors.html b/src/7.1/classes/ActiveModel/Errors.html index 88f3830131..2555d860d1 100644 --- a/src/7.1/classes/ActiveModel/Errors.html +++ b/src/7.1/classes/ActiveModel/Errors.html @@ -66,7 +66,7 @@

                Active Model Errors end

                -

                The last three methods are required in your object for Errors to be able to generate error messages correctly and also handle multiple languages. Of course, if you extend your object with ActiveModel::Translation you will not need to implement the last two. Likewise, using ActiveModel::Validations will handle the validation related methods for you.

                +

                The last three methods are required in your object for Errors to be able to generate error messages correctly and also handle multiple languages. Of course, if you extend your object with ActiveModel::Translation you will not need to implement the last two. Likewise, using ActiveModel::Validations will handle the validation related methods for you.

                The above allows you to do:

                @@ -239,7 +239,7 @@

                Attributes

                [R] errors -

                The actual array of Error objects This method is aliased to objects.

                +

                The actual array of Error objects This method is aliased to objects.

                @@ -247,7 +247,7 @@

                Attributes

                [R] objects -

                The actual array of Error objects This method is aliased to objects.

                +

                The actual array of Error objects This method is aliased to objects.

                @@ -366,7 +366,7 @@

                If type is a string, it will be used as error message.

                -

                If type is a symbol, it will be translated using the appropriate scope (see generate_message).

                +

                If type is a symbol, it will be translated using the appropriate scope (see generate_message).

                person.errors.add(:name, :blank)
                 person.errors.messages
                @@ -1355,7 +1355,7 @@ 

                -

                Returns a Hash of attributes with their error messages. If full_messages is true, it will contain full messages (see full_message).

                +

                Returns a Hash of attributes with their error messages. If full_messages is true, it will contain full messages (see full_message).

                person.errors.to_hash       # => {:name=>["cannot be nil"]}
                 person.errors.to_hash(true) # => {:name=>["name cannot be nil"]}
                diff --git a/src/7.1/classes/ActiveModel/Lint/Tests.html b/src/7.1/classes/ActiveModel/Lint/Tests.html
                index 03bb2637cb..5f3fef5826 100644
                --- a/src/7.1/classes/ActiveModel/Lint/Tests.html
                +++ b/src/7.1/classes/ActiveModel/Lint/Tests.html
                @@ -25,7 +25,7 @@ 

                Active Model Lint Tests

                -

                You can test whether an object is compliant with the Active Model API by including ActiveModel::Lint::Tests in your TestCase. It will include tests that tell you whether your object is fully compliant, or if not, which aspects of the API are not implemented.

                +

                You can test whether an object is compliant with the Active Model API by including ActiveModel::Lint::Tests in your TestCase. It will include tests that tell you whether your object is fully compliant, or if not, which aspects of the API are not implemented.

                Note an object is not required to implement all APIs in order to work with Action Pack. This module only intends to provide guidance in case you want all features out of the box.

                diff --git a/src/7.1/classes/ActiveModel/Model.html b/src/7.1/classes/ActiveModel/Model.html index 93d950f662..52a2260085 100644 --- a/src/7.1/classes/ActiveModel/Model.html +++ b/src/7.1/classes/ActiveModel/Model.html @@ -55,7 +55,7 @@

                Active Model B person.omg # => true

                -

                For more detailed information on other functionalities available, please refer to the specific modules included in ActiveModel::Model (see below).

                +

                For more detailed information on other functionalities available, please refer to the specific modules included in ActiveModel::Model (see below).

                diff --git a/src/7.1/classes/ActiveModel/Name.html b/src/7.1/classes/ActiveModel/Name.html index 23e4ec512c..609c5a25fd 100644 --- a/src/7.1/classes/ActiveModel/Name.html +++ b/src/7.1/classes/ActiveModel/Name.html @@ -376,7 +376,7 @@

                -

                Equivalent to #==.

                +

                Equivalent to ==.

                class BlogPost
                   extend ActiveModel::Naming
                @@ -587,7 +587,7 @@ 

                -

                Equivalent to to_s.

                +

                Equivalent to to_s.

                diff --git a/src/7.1/classes/ActiveModel/Naming.html b/src/7.1/classes/ActiveModel/Naming.html index 7ef3819b42..89116bd29e 100644 --- a/src/7.1/classes/ActiveModel/Naming.html +++ b/src/7.1/classes/ActiveModel/Naming.html @@ -25,7 +25,7 @@

                Active Model Naming

                -

                Creates a model_name method on your object.

                +

                Creates a model_name method on your object.

                To implement, just extend ActiveModel::Naming in your object:

                diff --git a/src/7.1/classes/ActiveModel/SecurePassword/ClassMethods.html b/src/7.1/classes/ActiveModel/SecurePassword/ClassMethods.html index 750d537cbb..46fd1dd1fb 100644 --- a/src/7.1/classes/ActiveModel/SecurePassword/ClassMethods.html +++ b/src/7.1/classes/ActiveModel/SecurePassword/ClassMethods.html @@ -97,7 +97,7 @@

                All of the above validations can be omitted by passing validations: false as an argument. This allows complete customizability of validation behavior.

                -

                To use has_secure_password, add bcrypt (~> 3.1.7) to your Gemfile:

                +

                To use has_secure_password, add bcrypt (~> 3.1.7) to your Gemfile:

                gem 'bcrypt', '~> 3.1.7'
                 
                diff --git a/src/7.1/classes/ActiveModel/Serialization.html b/src/7.1/classes/ActiveModel/Serialization.html index d8640bd52c..46c527187b 100644 --- a/src/7.1/classes/ActiveModel/Serialization.html +++ b/src/7.1/classes/ActiveModel/Serialization.html @@ -50,7 +50,7 @@

                Acti

                An attributes hash must be defined and should contain any attributes you need to be serialized. Attributes must be strings, not symbols. When called, serializable hash will use instance methods that match the name of the attributes hash’s keys. In order to override this behavior, take a look at the private method read_attribute_for_serialization.

                -

                ActiveModel::Serializers::JSON module automatically includes the ActiveModel::Serialization module, so there is no need to explicitly include ActiveModel::Serialization.

                +

                ActiveModel::Serializers::JSON module automatically includes the ActiveModel::Serialization module, so there is no need to explicitly include ActiveModel::Serialization.

                A minimal implementation including JSON would be:

                diff --git a/src/7.1/classes/ActiveModel/Serializers/JSON.html b/src/7.1/classes/ActiveModel/Serializers/JSON.html index e5c1da805a..013ee7ef89 100644 --- a/src/7.1/classes/ActiveModel/Serializers/JSON.html +++ b/src/7.1/classes/ActiveModel/Serializers/JSON.html @@ -92,7 +92,7 @@

                Returns a hash representing the model. Some configuration can be passed through options.

                -

                The option include_root_in_json controls the top-level behavior of as_json. If true, as_json will emit a single root node named after the object’s type. The default value for include_root_in_json option is false.

                +

                The option include_root_in_json controls the top-level behavior of as_json. If true, as_json will emit a single root node named after the object’s type. The default value for include_root_in_json option is false.

                user = User.find(1)
                 user.as_json
                diff --git a/src/7.1/classes/ActiveModel/Translation.html b/src/7.1/classes/ActiveModel/Translation.html
                index 08867bac7f..d70b23bc2a 100644
                --- a/src/7.1/classes/ActiveModel/Translation.html
                +++ b/src/7.1/classes/ActiveModel/Translation.html
                @@ -37,7 +37,7 @@ 

                Active M # => "My attribute"

                -

                This also provides the required class methods for hooking into the Rails internationalization API, including being able to define a class-based i18n_scope and lookup_ancestors to find translations in parent classes.

                +

                This also provides the required class methods for hooking into the Rails internationalization API, including being able to define a class-based i18n_scope and lookup_ancestors to find translations in parent classes.

                @@ -170,7 +170,7 @@

                -

                Returns the i18n_scope for the class. Override if you want custom lookup.

                +

                Returns the i18n_scope for the class. Override if you want custom lookup.

                diff --git a/src/7.1/classes/ActiveModel/Type/Boolean.html b/src/7.1/classes/ActiveModel/Type/Boolean.html index ee011a10d4..9b249229c7 100644 --- a/src/7.1/classes/ActiveModel/Type/Boolean.html +++ b/src/7.1/classes/ActiveModel/Type/Boolean.html @@ -35,7 +35,7 @@

                Activ

                A class that behaves like a boolean type, including rules for coercion of user input.

                • -

                  "false", "f", "0", 0 or any other value in FALSE_VALUES will be coerced to false.

                  +

                  "false", "f", "0", 0 or any other value in FALSE_VALUES will be coerced to false.

                • Empty strings are coerced to nil.

                • diff --git a/src/7.1/classes/ActiveModel/Type/Value.html b/src/7.1/classes/ActiveModel/Type/Value.html index 614c90d9bc..b1c551a41c 100644 --- a/src/7.1/classes/ActiveModel/Type/Value.html +++ b/src/7.1/classes/ActiveModel/Type/Value.html @@ -581,7 +581,7 @@

                  -

                  Casts a value from the ruby type to a type that the database knows how to understand. The returned value from this method should be a String, Numeric, Date, Time, Symbol, true, false, or nil.

                  +

                  Casts a value from the ruby type to a type that the database knows how to understand. The returned value from this method should be a String, Numeric, Date, Time, Symbol, true, false, or nil.

                  diff --git a/src/7.1/classes/ActiveModel/Validations.html b/src/7.1/classes/ActiveModel/Validations.html index 20ca945a5a..6189f0742f 100644 --- a/src/7.1/classes/ActiveModel/Validations.html +++ b/src/7.1/classes/ActiveModel/Validations.html @@ -86,7 +86,7 @@

                  Active M person.errors.messages # => {first_name:["starts with z."]}

                -

                Note that ActiveModel::Validations automatically adds an errors method to your instances initialized with a new ActiveModel::Errors object, so there is no need for you to do this manually.

                +

                Note that ActiveModel::Validations automatically adds an errors method to your instances initialized with a new ActiveModel::Errors object, so there is no need for you to do this manually.

                @@ -215,7 +215,7 @@

                -

                Returns the Errors object that holds all information about attribute error messages.

                +

                Returns the Errors object that holds all information about attribute error messages.

                class Person
                   include ActiveModel::Validations
                @@ -421,7 +421,7 @@ 

                -

                Runs all the validations within the specified context. Returns true if no errors are found, raises ValidationError otherwise.

                +

                Runs all the validations within the specified context. Returns true if no errors are found, raises ValidationError otherwise.

                Validations with no :on option will run no matter the context. Validations with some :on option will only run in the specified context.

                @@ -486,7 +486,7 @@

                end

                -

                Standard configuration options (:on, :if and :unless), which are available on the class version of validates_with, should instead be placed on the validates method as these are applied and tested in the callback.

                +

                Standard configuration options (:on, :if and :unless), which are available on the class version of validates_with, should instead be placed on the validates method as these are applied and tested in the callback.

                If you pass any additional configuration options, they will be passed to the class and available as options, please refer to the class version of this method for more information.

                diff --git a/src/7.1/classes/ActiveModel/Validations/Callbacks.html b/src/7.1/classes/ActiveModel/Validations/Callbacks.html index 149f0ba227..47456a07de 100644 --- a/src/7.1/classes/ActiveModel/Validations/Callbacks.html +++ b/src/7.1/classes/ActiveModel/Validations/Callbacks.html @@ -27,7 +27,7 @@

                ClassMethods#before_validation and ClassMethods#after_validation callbacks.

                -

                First, include ActiveModel::Validations::Callbacks from the class you are creating:

                +

                First, include ActiveModel::Validations::Callbacks from the class you are creating:

                class MyModel
                   include ActiveModel::Validations::Callbacks
                diff --git a/src/7.1/classes/ActiveModel/Validations/ClassMethods.html b/src/7.1/classes/ActiveModel/Validations/ClassMethods.html
                index 8ece0c671f..e223ee0818 100644
                --- a/src/7.1/classes/ActiveModel/Validations/ClassMethods.html
                +++ b/src/7.1/classes/ActiveModel/Validations/ClassMethods.html
                @@ -149,7 +149,7 @@ 

                Clears all of the validators and validations.

                -

                Note that this will clear anything that is being used to validate the model for both the validates_with and validate methods. It clears the validators that are created with an invocation of validates_with and the callbacks that are set by an invocation of validate.

                +

                Note that this will clear anything that is being used to validate the model for both the validates_with and validate methods. It clears the validators that are created with an invocation of validates_with and the callbacks that are set by an invocation of validate.

                class Person
                   include ActiveModel::Validations
                @@ -596,7 +596,7 @@ 

                end

                -

                There is no default error message for validates_with. You must manually add errors to the record’s errors collection in the validator class.

                +

                There is no default error message for validates_with. You must manually add errors to the record’s errors collection in the validator class.

                To implement the validate method, you must have a record parameter defined, which is the record to be validated.

                @@ -673,7 +673,7 @@

                -

                List all validators that are being used to validate the model using validates_with method.

                +

                List all validators that are being used to validate the model using validates_with method.

                class Person
                   include ActiveModel::Validations
                diff --git a/src/7.1/classes/ActiveModel/Validations/HelperMethods.html b/src/7.1/classes/ActiveModel/Validations/HelperMethods.html
                index fc2ac40f5d..125899bd14 100644
                --- a/src/7.1/classes/ActiveModel/Validations/HelperMethods.html
                +++ b/src/7.1/classes/ActiveModel/Validations/HelperMethods.html
                @@ -644,7 +644,7 @@ 

                -

                Validates whether the value of the specified attribute is numeric by trying to convert it to a float with Kernel.Float (if only_integer is false) or applying it to the regular expression /\A[+\-]?\d+\z/ (if only_integer is set to true). Precision of Kernel.Float values are guaranteed up to 15 digits.

                +

                Validates whether the value of the specified attribute is numeric by trying to convert it to a float with Kernel.Float (if only_integer is false) or applying it to the regular expression /\A[+\-]?\d+\z/ (if only_integer is set to true). Precision of Kernel.Float values are guaranteed up to 15 digits.

                class Person < ActiveRecord::Base
                   validates_numericality_of :value, on: :create
                diff --git a/src/7.1/classes/ActiveRecord/Associations/ClassMethods.html b/src/7.1/classes/ActiveRecord/Associations/ClassMethods.html
                index 7899218d8f..056a4f1dcb 100644
                --- a/src/7.1/classes/ActiveRecord/Associations/ClassMethods.html
                +++ b/src/7.1/classes/ActiveRecord/Associations/ClassMethods.html
                @@ -66,7 +66,7 @@ 

                A word of warning

                -

                Don’t create associations that have the same name as instance methods of ActiveRecord::Base. Since the association adds a method with that name to its model, using an association with the same name as one provided by ActiveRecord::Base will override the method inherited through ActiveRecord::Base and will break things. For instance, attributes and connection would be bad choices for association names, because those names already exist in the list of ActiveRecord::Base instance methods.

                +

                Don’t create associations that have the same name as instance methods of ActiveRecord::Base. Since the association adds a method with that name to its model, using an association with the same name as one provided by ActiveRecord::Base will override the method inherited through ActiveRecord::Base and will break things. For instance, attributes and connection would be bad choices for association names, because those names already exist in the list of ActiveRecord::Base instance methods.

                Auto-generated methods

                @@ -239,7 +239,7 @@

                ActiveRecord::RecordNotSaved exception is raised and the assignment is cancelled.

              • -

                If you wish to assign an object to a has_one association without saving it, use the #build_association method (documented below). The object being replaced will still be saved to update its foreign key.

                +

                If you wish to assign an object to a has_one association without saving it, use the build_association method (documented below). The object being replaced will still be saved to update its foreign key.

              • Assigning an object to a belongs_to association does not save the object, since the foreign key field belongs on the parent. It does not save the parent either.

              @@ -259,7 +259,7 @@

              Colle

              Customizing the query

              -

              Associations are built from Relation objects, and you can use the Relation syntax to customize them. For example, to add a condition:

              +

              Associations are built from Relation objects, and you can use the Relation syntax to customize them. For example, to add a condition:

              class Blog < ActiveRecord::Base
                 has_many :published_posts, -> { where(published: true) }, class_name: 'Post'
              @@ -899,31 +899,31 @@ 

              Methods will be added for retrieval and query for a single associated object, for which this object holds an id:

              association is a placeholder for the symbol passed as the name argument, so belongs_to :author would add among others author.nil?.

              -
              association +
              association

              Returns the associated object. nil is returned if none is found.

              -
              association=(associate) +
              association=(associate)

              Assigns the associate object, extracts the primary key, and sets it as the foreign key. No modification or deletion of existing records takes place.

              -
              build_association(attributes = {}) +
              build_association(attributes = {})

              Returns a new object of the associated type that has been instantiated with attributes and linked to this object through a foreign key, but has not yet been saved.

              -
              create_association(attributes = {}) +
              create_association(attributes = {})

              Returns a new object of the associated type that has been instantiated with attributes, linked to this object through a foreign key, and that has already been saved (if it passed the validation).

              -
              create_association!(attributes = {}) +
              create_association!(attributes = {})

              Does the same as create_association, but raises ActiveRecord::RecordInvalid if the record is invalid.

              -
              reload_association +
              reload_association

              Returns the associated object, forcing a database read.

              -
              reset_association +
              reset_association

              Unloads the associated object. The next access will query it from the database.

              -
              association_changed? +
              association_changed?

              Returns true if a new associate object has been assigned and the next save will update the foreign key.

              -
              association_previously_changed? +
              association_previously_changed?

              Returns true if the previous save updated the association to reference a new associate object.

              @@ -965,59 +965,59 @@

              Scopes

              Options

              The declaration can also include an options hash to specialize the behavior of the association.

              -
              :class_name +
              :class_name

              Specify the class name of the association. Use it only if that name can’t be inferred from the association name. So belongs_to :author will by default be linked to the Author class, but if the real class name is Person, you’ll have to specify it with this option.

              -
              :foreign_key +
              :foreign_key

              Specify the foreign key used for the association. By default this is guessed to be the name of the association with an “_id” suffix. So a class that defines a belongs_to :person association will use “person_id” as the default :foreign_key. Similarly, belongs_to :favorite_person, class_name: "Person" will use a foreign key of “favorite_person_id”.

              Setting the :foreign_key option prevents automatic detection of the association’s inverse, so it is generally a good idea to set the :inverse_of option as well.

              -
              :foreign_type +
              :foreign_type

              Specify the column used to store the associated object’s type, if this is a polymorphic association. By default this is guessed to be the name of the association with a “_type” suffix. So a class that defines a belongs_to :taggable, polymorphic: true association will use “taggable_type” as the default :foreign_type.

              -
              :primary_key +
              :primary_key

              Specify the method that returns the primary key of associated object used for the association. By default this is id.

              -
              :dependent +
              :dependent

              If set to :destroy, the associated object is destroyed when this object is. If set to :delete, the associated object is deleted without calling its destroy method. If set to :destroy_async, the associated object is scheduled to be destroyed in a background job. This option should not be specified when belongs_to is used in conjunction with a has_many relationship on another class because of the potential to leave orphaned records behind.

              -
              :counter_cache +
              :counter_cache

              Caches the number of belonging objects on the associate class through the use of CounterCache::ClassMethods#increment_counter and CounterCache::ClassMethods#decrement_counter. The counter cache is incremented when an object of this class is created and decremented when it’s destroyed. This requires that a column named #{table_name}_count (such as comments_count for a belonging Comment class) is used on the associate class (such as a Post class) - that is the migration for #{table_name}_count is created on the associate class (such that Post.comments_count will return the count cached, see note below). You can also specify a custom counter cache column by providing a column name instead of a true/false value to this option (e.g., counter_cache: :my_custom_counter.) Note: Specifying a counter cache will add it to that model’s list of readonly attributes using attr_readonly.

              -
              :polymorphic +
              :polymorphic

              Specify this association is a polymorphic association by passing true. Note: If you’ve enabled the counter cache, then you may want to add the counter cache attribute to the attr_readonly list in the associated classes (e.g. class Post; attr_readonly :comments_count; end).

              -
              :validate +
              :validate

              When set to true, validates new objects added to association when saving the parent object. false by default. If you want to ensure associated objects are revalidated on every update, use validates_associated.

              -
              :autosave +
              :autosave

              If true, always save the associated object or destroy it if marked for destruction, when saving the parent object. If false, never save or destroy the associated object. By default, only save the associated object if it’s a new record.

              Note that NestedAttributes::ClassMethods#accepts_nested_attributes_for sets :autosave to true.

              -
              :touch +
              :touch

              If true, the associated object will be touched (the updated_at / updated_on attributes set to current time) when this record is either saved or destroyed. If you specify a symbol, that attribute will be updated with the current time in addition to the updated_at / updated_on attribute. Please note that no validation will be performed when touching, and only the after_touch, after_commit, and after_rollback callbacks will be executed.

              -
              :inverse_of +
              :inverse_of

              Specifies the name of the has_one or has_many association on the associated object that is the inverse of this belongs_to association. See ActiveRecord::Associations::ClassMethods‘s overview on Bi-directional associations for more detail.

              -
              :optional +
              :optional

              When set to true, the association will not have its presence validated.

              -
              :required +
              :required

              When set to true, the association will also have its presence validated. This will validate the association itself, not the id. You can use :inverse_of to avoid an extra query during validation. NOTE: required is set to true by default and is deprecated. If you don’t want to have association presence validated, use optional: true.

              -
              :default +
              :default

              Provide a callable (i.e. proc or lambda) to specify that the association should be initialized with a particular record before validation. Please note that callable won’t be executed if the record exists.

              -
              :strict_loading +
              :strict_loading

              Enforces strict loading every time the associated record is loaded through this association.

              -
              :ensuring_owner_was +
              :ensuring_owner_was

              Specifies an instance method to be called on the owner. The method must return true in order for the associated records to be deleted in a background job.

              -
              :query_constraints +
              :query_constraints

              Serves as a composite foreign key. Defines the list of columns to be used to query the associated object. This is an optional option. By default Rails will attempt to derive the value automatically. When the value is set the Array size must match associated model’s primary key or query_constraints size.

              @@ -1090,49 +1090,49 @@

              Adds the following methods for retrieval and query:

              collection is a placeholder for the symbol passed as the name argument, so has_and_belongs_to_many :categories would add among others categories.empty?.

              -
              collection +
              collection

              Returns a Relation of all the associated objects. An empty Relation is returned if none are found.

              -
              collection<<(object, ...) +
              collection<<(object, ...)

              Adds one or more objects to the collection by creating associations in the join table (collection.push and collection.concat are aliases to this method). Note that this operation instantly fires update SQL without waiting for the save or update call on the parent object, unless the parent object is a new record.

              -
              collection.delete(object, ...) +
              collection.delete(object, ...)

              Removes one or more objects from the collection by removing their associations from the join table. This does not destroy the objects.

              -
              collection.destroy(object, ...) +
              collection.destroy(object, ...)

              Removes one or more objects from the collection by running destroy on each association in the join table, overriding any dependent option. This does not destroy the objects.

              -
              collection=objects +
              collection=objects

              Replaces the collection’s content by deleting and adding objects as appropriate.

              -
              collection_singular_ids +
              collection_singular_ids

              Returns an array of the associated objects’ ids.

              -
              collection_singular_ids=ids +
              collection_singular_ids=ids

              Replace the collection by the objects identified by the primary keys in ids.

              -
              collection.clear +
              collection.clear

              Removes every object from the collection. This does not destroy the objects.

              -
              collection.empty? +
              collection.empty?

              Returns true if there are no associated objects.

              -
              collection.size +
              collection.size

              Returns the number of associated objects.

              -
              collection.find(id) +
              collection.find(id)

              Finds an associated object responding to the id and that meets the condition that it has to be associated with this object. Uses the same rules as ActiveRecord::FinderMethods#find.

              -
              collection.exists?(...) +
              collection.exists?(...)

              Checks whether an associated object with the given conditions exists. Uses the same rules as ActiveRecord::FinderMethods#exists?.

              -
              collection.build(attributes = {}) +
              collection.build(attributes = {})

              Returns a new object of the collection type that has been instantiated with attributes and linked to this object through the join table, but has not yet been saved.

              -
              collection.create(attributes = {}) +
              collection.create(attributes = {})

              Returns a new object of the collection type that has been instantiated with attributes, linked to this object through the join table, and that has already been saved (if it passed the validation).

              -
              collection.reload +
              collection.reload

              Returns a Relation of all of the associated objects, forcing a database read. An empty Relation is returned if none are found.

              @@ -1195,29 +1195,29 @@

              Extensions

              Options

              -
              :class_name +
              :class_name

              Specify the class name of the association. Use it only if that name can’t be inferred from the association name. So has_and_belongs_to_many :projects will by default be linked to the Project class, but if the real class name is SuperProject, you’ll have to specify it with this option.

              -
              :join_table +
              :join_table

              Specify the name of the join table if the default based on lexical order isn’t what you want. WARNING: If you’re overwriting the table name of either class, the table_name method MUST be declared underneath any has_and_belongs_to_many declaration in order to work.

              -
              :foreign_key +
              :foreign_key

              Specify the foreign key used for the association. By default this is guessed to be the name of this class in lower-case and “_id” suffixed. So a Person class that makes a has_and_belongs_to_many association to Project will use “person_id” as the default :foreign_key.

              Setting the :foreign_key option prevents automatic detection of the association’s inverse, so it is generally a good idea to set the :inverse_of option as well.

              -
              :association_foreign_key +
              :association_foreign_key

              Specify the foreign key used for the association on the receiving side of the association. By default this is guessed to be the name of the associated class in lower-case and “_id” suffixed. So if a Person class makes a has_and_belongs_to_many association to Project, the association will use “project_id” as the default :association_foreign_key.

              -
              :validate +
              :validate

              When set to true, validates new objects added to association when saving the parent object. true by default. If you want to ensure associated objects are revalidated on every update, use validates_associated.

              -
              :autosave +
              :autosave

              If true, always save the associated objects or destroy them if marked for destruction, when saving the parent object. If false, never save or destroy the associated objects. By default, only save associated objects that are new records.

              Note that NestedAttributes::ClassMethods#accepts_nested_attributes_for sets :autosave to true.

              -
              :strict_loading +
              :strict_loading

              Enforces strict loading every time an associated record is loaded through this association.

              @@ -1302,56 +1302,56 @@

              Specifies a one-to-many association. The following methods for retrieval and query of collections of associated objects will be added:

              collection is a placeholder for the symbol passed as the name argument, so has_many :clients would add among others clients.empty?.

              -
              collection +
              collection

              Returns a Relation of all the associated objects. An empty Relation is returned if none are found.

              -
              collection<<(object, ...) +
              collection<<(object, ...)

              Adds one or more objects to the collection by setting their foreign keys to the collection’s primary key. Note that this operation instantly fires update SQL without waiting for the save or update call on the parent object, unless the parent object is a new record. This will also run validations and callbacks of associated object(s).

              -
              collection.delete(object, ...) +
              collection.delete(object, ...)

              Removes one or more objects from the collection by setting their foreign keys to NULL. Objects will be in addition destroyed if they’re associated with dependent: :destroy, and deleted if they’re associated with dependent: :delete_all.

              If the :through option is used, then the join records are deleted (rather than nullified) by default, but you can specify dependent: :destroy or dependent: :nullify to override this.

              -
              collection.destroy(object, ...) +
              collection.destroy(object, ...)

              Removes one or more objects from the collection by running destroy on each record, regardless of any dependent option, ensuring callbacks are run.

              If the :through option is used, then the join records are destroyed instead, not the objects themselves.

              -
              collection=objects +
              collection=objects

              Replaces the collections content by deleting and adding objects as appropriate. If the :through option is true callbacks in the join models are triggered except destroy callbacks, since deletion is direct by default. You can specify dependent: :destroy or dependent: :nullify to override this.

              -
              collection_singular_ids +
              collection_singular_ids

              Returns an array of the associated objects’ ids

              -
              collection_singular_ids=ids +
              collection_singular_ids=ids

              Replace the collection with the objects identified by the primary keys in ids. This method loads the models and calls collection=. See above.

              -
              collection.clear +
              collection.clear

              Removes every object from the collection. This destroys the associated objects if they are associated with dependent: :destroy, deletes them directly from the database if dependent: :delete_all, otherwise sets their foreign keys to NULL. If the :through option is true no destroy callbacks are invoked on the join models. Join models are directly deleted.

              -
              collection.empty? +
              collection.empty?

              Returns true if there are no associated objects.

              -
              collection.size +
              collection.size

              Returns the number of associated objects.

              -
              collection.find(...) +
              collection.find(...)

              Finds an associated object according to the same rules as ActiveRecord::FinderMethods#find.

              -
              collection.exists?(...) +
              collection.exists?(...)

              Checks whether an associated object with the given conditions exists. Uses the same rules as ActiveRecord::FinderMethods#exists?.

              -
              collection.build(attributes = {}, ...) +
              collection.build(attributes = {}, ...)

              Returns one or more new objects of the collection type that have been instantiated with attributes and linked to this object through a foreign key, but have not yet been saved.

              -
              collection.create(attributes = {}) +
              collection.create(attributes = {})

              Returns a new object of the collection type that has been instantiated with attributes, linked to this object through a foreign key, and that has already been saved (if it passed the validation). Note: This only works if the base model already exists in the DB, not if it is a new (unsaved) record!

              -
              collection.create!(attributes = {}) +
              collection.create!(attributes = {})

              Does the same as collection.create, but raises ActiveRecord::RecordInvalid if the record is invalid.

              -
              collection.reload +
              collection.reload

              Returns a Relation of all of the associated objects, forcing a database read. An empty Relation is returned if none are found.

              @@ -1414,21 +1414,21 @@

              Extensions

            Options

            -
            :class_name +
            :class_name

            Specify the class name of the association. Use it only if that name can’t be inferred from the association name. So has_many :products will by default be linked to the Product class, but if the real class name is SpecialProduct, you’ll have to specify it with this option.

            -
            :foreign_key +
            :foreign_key

            Specify the foreign key used for the association. By default this is guessed to be the name of this class in lower-case and “_id” suffixed. So a Person class that makes a has_many association will use “person_id” as the default :foreign_key.

            Setting the :foreign_key option prevents automatic detection of the association’s inverse, so it is generally a good idea to set the :inverse_of option as well.

            -
            :foreign_type +
            :foreign_type

            Specify the column used to store the associated object’s type, if this is a polymorphic association. By default this is guessed to be the name of the polymorphic association specified on “as” option with a “_type” suffix. So a class that defines a has_many :tags, as: :taggable association will use “taggable_type” as the default :foreign_type.

            -
            :primary_key +
            :primary_key

            Specify the name of the column to use as the primary key for the association. By default this is id.

            -
            :dependent +
            :dependent

            Controls what happens to the associated objects when their owner is destroyed. Note that these are implemented as callbacks, and Rails executes callbacks in order. Therefore, other similar callbacks may affect the :dependent behavior, and the :dependent behavior may affect other callbacks.

            • @@ -1450,52 +1450,52 @@

              Options

              If using with the :through option, the association on the join model must be a belongs_to, and the records which get deleted are the join records, rather than the associated records.

              If using dependent: :destroy on a scoped association, only the scoped objects are destroyed. For example, if a Post model defines has_many :comments, -> { where published: true }, dependent: :destroy and destroy is called on a post, only published comments are destroyed. This means that any unpublished comments in the database would still contain a foreign key pointing to the now deleted post.

              -
            :counter_cache +
            :counter_cache

            This option can be used to configure a custom named :counter_cache. You only need this option, when you customized the name of your :counter_cache on the belongs_to association.

            -
            :as +
            :as

            Specifies a polymorphic interface (See belongs_to).

            -
            :through +
            :through

            Specifies an association through which to perform the query. This can be any other type of association, including other :through associations. Options for :class_name, :primary_key and :foreign_key are ignored, as the association uses the source reflection.

            If the association on the join model is a belongs_to, the collection can be modified and the records on the :through model will be automatically created and removed as appropriate. Otherwise, the collection is read-only, so you should manipulate the :through association directly.

            If you are going to modify the association (rather than just read from it), then it is a good idea to set the :inverse_of option on the source association on the join model. This allows associated records to be built which will automatically create the appropriate join model records when they are saved. (See the ‘Association Join Models’ and ‘Setting Inverses’ sections above.)

            -
            :disable_joins +
            :disable_joins
            -

            Specifies whether joins should be skipped for an association. If set to true, two or more queries will be generated. Note that in some cases, if order or limit is applied, it will be done in-memory due to database limitations. This option is only applicable on has_many :through associations as has_many alone do not perform a join.

            -
            :source +

            Specifies whether joins should be skipped for an association. If set to true, two or more queries will be generated. Note that in some cases, if order or limit is applied, it will be done in-memory due to database limitations. This option is only applicable on has_many :through associations as has_many alone do not perform a join.

            +
            :source

            Specifies the source association name used by has_many :through queries. Only use it if the name cannot be inferred from the association. has_many :subscribers, through: :subscriptions will look for either :subscribers or :subscriber on Subscription, unless a :source is given.

            -
            :source_type +
            :source_type

            Specifies type of the source association used by has_many :through queries where the source association is a polymorphic belongs_to.

            -
            :validate +
            :validate

            When set to true, validates new objects added to association when saving the parent object. true by default. If you want to ensure associated objects are revalidated on every update, use validates_associated.

            -
            :autosave +
            :autosave

            If true, always save the associated objects or destroy them if marked for destruction, when saving the parent object. If false, never save or destroy the associated objects. By default, only save associated objects that are new records. This option is implemented as a before_save callback. Because callbacks are run in the order they are defined, associated objects may need to be explicitly saved in any user-defined before_save callbacks.

            Note that NestedAttributes::ClassMethods#accepts_nested_attributes_for sets :autosave to true.

            -
            :inverse_of +
            :inverse_of

            Specifies the name of the belongs_to association on the associated object that is the inverse of this has_many association. See ActiveRecord::Associations::ClassMethods‘s overview on Bi-directional associations for more detail.

            -
            :extend +
            :extend

            Specifies a module or array of modules that will be extended into the association object returned. Useful for defining methods on associations, especially when they should be shared between multiple association objects.

            -
            :strict_loading +
            :strict_loading

            When set to true, enforces strict loading every time the associated record is loaded through this association.

            -
            :ensuring_owner_was +
            :ensuring_owner_was

            Specifies an instance method to be called on the owner. The method must return true in order for the associated records to be deleted in a background job.

            -
            :query_constraints +
            :query_constraints

            Serves as a composite foreign key. Defines the list of columns to be used to query the associated object. This is an optional option. By default Rails will attempt to derive the value automatically. When the value is set the Array size must match associated model’s primary key or query_constraints size.

            -
            :index_errors +
            :index_errors

            Enables differentiation of multiple validation errors from the association records, by including an index in the error attribute name, e.g. roles[2].level. The index is based on association order, i.e. database order, with yet to be persisted new records placed at the end.

            @@ -1555,25 +1555,25 @@

            The following methods for retrieval and query of a single associated object will be added:

            association is a placeholder for the symbol passed as the name argument, so has_one :manager would add among others manager.nil?.

            -
            association +
            association

            Returns the associated object. nil is returned if none is found.

            -
            association=(associate) +
            association=(associate)

            Assigns the associate object, extracts the primary key, sets it as the foreign key, and saves the associate object. To avoid database inconsistencies, permanently deletes an existing associated object when assigning a new one, even if the new one isn’t saved to database.

            -
            build_association(attributes = {}) +
            build_association(attributes = {})

            Returns a new object of the associated type that has been instantiated with attributes and linked to this object through a foreign key, but has not yet been saved.

            -
            create_association(attributes = {}) +
            create_association(attributes = {})

            Returns a new object of the associated type that has been instantiated with attributes, linked to this object through a foreign key, and that has already been saved (if it passed the validation).

            -
            create_association!(attributes = {}) +
            create_association!(attributes = {})

            Does the same as create_association, but raises ActiveRecord::RecordInvalid if the record is invalid.

            -
            reload_association +
            reload_association

            Returns the associated object, forcing a database read.

            -
            reset_association +
            reset_association

            Unloads the associated object. The next access will query it from the database.

            @@ -1615,10 +1615,10 @@

            Options

            The declaration can also include an options hash to specialize the behavior of the association.

            Options are:

            -
            :class_name +
            :class_name

            Specify the class name of the association. Use it only if that name can’t be inferred from the association name. So has_one :manager will by default be linked to the Manager class, but if the real class name is Person, you’ll have to specify it with this option.

            -
            :dependent +
            :dependent

            Controls what happens to the associated object when its owner is destroyed:

            • @@ -1638,60 +1638,60 @@

              Options

            Note that :dependent option is ignored when using :through option.

            -
            :foreign_key +
            :foreign_key

            Specify the foreign key used for the association. By default this is guessed to be the name of this class in lower-case and “_id” suffixed. So a Person class that makes a has_one association will use “person_id” as the default :foreign_key.

            Setting the :foreign_key option prevents automatic detection of the association’s inverse, so it is generally a good idea to set the :inverse_of option as well.

            -
            :foreign_type +
            :foreign_type

            Specify the column used to store the associated object’s type, if this is a polymorphic association. By default this is guessed to be the name of the polymorphic association specified on “as” option with a “_type” suffix. So a class that defines a has_one :tag, as: :taggable association will use “taggable_type” as the default :foreign_type.

            -
            :primary_key +
            :primary_key

            Specify the method that returns the primary key used for the association. By default this is id.

            -
            :as +
            :as

            Specifies a polymorphic interface (See belongs_to).

            -
            :through +
            :through

            Specifies a Join Model through which to perform the query. Options for :class_name, :primary_key, and :foreign_key are ignored, as the association uses the source reflection. You can only use a :through query through a has_one or belongs_to association on the join model.

            If the association on the join model is a belongs_to, the collection can be modified and the records on the :through model will be automatically created and removed as appropriate. Otherwise, the collection is read-only, so you should manipulate the :through association directly.

            If you are going to modify the association (rather than just read from it), then it is a good idea to set the :inverse_of option on the source association on the join model. This allows associated records to be built which will automatically create the appropriate join model records when they are saved. (See the ‘Association Join Models’ and ‘Setting Inverses’ sections above.)

            -
            :disable_joins +
            :disable_joins
            -

            Specifies whether joins should be skipped for an association. If set to true, two or more queries will be generated. Note that in some cases, if order or limit is applied, it will be done in-memory due to database limitations. This option is only applicable on has_one :through associations as has_one alone does not perform a join.

            -
            :source +

            Specifies whether joins should be skipped for an association. If set to true, two or more queries will be generated. Note that in some cases, if order or limit is applied, it will be done in-memory due to database limitations. This option is only applicable on has_one :through associations as has_one alone does not perform a join.

            +
            :source

            Specifies the source association name used by has_one :through queries. Only use it if the name cannot be inferred from the association. has_one :favorite, through: :favorites will look for a :favorite on Favorite, unless a :source is given.

            -
            :source_type +
            :source_type

            Specifies type of the source association used by has_one :through queries where the source association is a polymorphic belongs_to.

            -
            :validate +
            :validate

            When set to true, validates new objects added to association when saving the parent object. false by default. If you want to ensure associated objects are revalidated on every update, use validates_associated.

            -
            :autosave +
            :autosave

            If true, always save the associated object or destroy it if marked for destruction, when saving the parent object. If false, never save or destroy the associated object. By default, only save the associated object if it’s a new record.

            Note that NestedAttributes::ClassMethods#accepts_nested_attributes_for sets :autosave to true.

            -
            :touch +
            :touch

            If true, the associated object will be touched (the updated_at / updated_on attributes set to current time) when this record is either saved or destroyed. If you specify a symbol, that attribute will be updated with the current time in addition to the updated_at / updated_on attribute. Please note that no validation will be performed when touching, and only the after_touch, after_commit, and after_rollback callbacks will be executed.

            -
            :inverse_of +
            :inverse_of

            Specifies the name of the belongs_to association on the associated object that is the inverse of this has_one association. See ActiveRecord::Associations::ClassMethods‘s overview on Bi-directional associations for more detail.

            -
            :required +
            :required

            When set to true, the association will also have its presence validated. This will validate the association itself, not the id. You can use :inverse_of to avoid an extra query during validation.

            -
            :strict_loading +
            :strict_loading

            Enforces strict loading every time the associated record is loaded through this association.

            -
            :ensuring_owner_was +
            :ensuring_owner_was

            Specifies an instance method to be called on the owner. The method must return true in order for the associated records to be deleted in a background job.

            -
            :query_constraints +
            :query_constraints

            Serves as a composite foreign key. Defines the list of columns to be used to query the associated object. This is an optional option. By default Rails will attempt to derive the value automatically. When the value is set the Array size must match associated model’s primary key or query_constraints size.

            diff --git a/src/7.1/classes/ActiveRecord/Associations/CollectionProxy.html b/src/7.1/classes/ActiveRecord/Associations/CollectionProxy.html index e789650ca6..b03fe40251 100644 --- a/src/7.1/classes/ActiveRecord/Associations/CollectionProxy.html +++ b/src/7.1/classes/ActiveRecord/Associations/CollectionProxy.html @@ -562,7 +562,7 @@

            -

            Equivalent to delete_all. The difference is that returns self, instead of an array with the deleted objects, so methods can be chained. See delete_all for more information. Note that because delete_all removes records by directly running an SQL query into the database, the updated_at column of the object is not changed.

            +

            Equivalent to delete_all. The difference is that returns self, instead of an array with the deleted objects, so methods can be chained. See delete_all for more information. Note that because delete_all removes records by directly running an SQL query into the database, the updated_at column of the object is not changed.

            @@ -860,7 +860,7 @@

            # => ActiveRecord::RecordNotFound: Couldn't find Pet with 'id'=1

          -

          You can pass Integer or String values, it finds the records responding to the id and executes delete on them.

          +

          You can pass Integer or String values, it finds the records responding to the id and executes delete on them.

          class Person < ActiveRecord::Base
             has_many :pets
          @@ -1062,7 +1062,7 @@ 

          Pet.find(1, 2, 3) # => ActiveRecord::RecordNotFound: Couldn't find all Pets with 'id': (1, 2, 3)

          -

          You can pass Integer or String values, it finds the records responding to the id and then deletes them from the database.

          +

          You can pass Integer or String values, it finds the records responding to the id and then deletes them from the database.

          person.pets.size # => 3
           person.pets
          diff --git a/src/7.1/classes/ActiveRecord/AttributeMethods.html b/src/7.1/classes/ActiveRecord/AttributeMethods.html
          index 940381a403..19b9eb62c9 100644
          --- a/src/7.1/classes/ActiveRecord/AttributeMethods.html
          +++ b/src/7.1/classes/ActiveRecord/AttributeMethods.html
          @@ -399,7 +399,7 @@ 

          -

          Returns an #inspect-like string for the value of the attribute attr_name. String attributes are truncated up to 50 characters. Other attributes return the value of #inspect without modification.

          +

          Returns an inspect-like string for the value of the attribute attr_name. String attributes are truncated up to 50 characters. Other attributes return the value of inspect without modification.

          person = Person.create!(name: 'David Heinemeier Hansson ' * 3)
           
          diff --git a/src/7.1/classes/ActiveRecord/AttributeMethods/Dirty.html b/src/7.1/classes/ActiveRecord/AttributeMethods/Dirty.html
          index 3c743c7d90..1561dec00a 100644
          --- a/src/7.1/classes/ActiveRecord/AttributeMethods/Dirty.html
          +++ b/src/7.1/classes/ActiveRecord/AttributeMethods/Dirty.html
          @@ -500,10 +500,10 @@ 

          This method is useful in after callbacks to determine if an attribute was changed during the save that triggered the callbacks to run. It can be invoked as saved_change_to_name? instead of saved_change_to_attribute?("name").

          Options

          -
          from +
          from

          When specified, this method will return false unless the original value is equal to the given value.

          -
          to +
          to

          When specified, this method will return false unless the value will be changed to the given value.

          @@ -616,10 +616,10 @@

          This method is useful in validations and before callbacks to determine if the next call to save will change a particular attribute. It can be invoked as will_save_change_to_name? instead of will_save_change_to_attribute?("name").

          Options

          -
          from +
          from

          When specified, this method will return false unless the original value is equal to the given value.

          -
          to +
          to

          When specified, this method will return false unless the value will be changed to the given value.

          diff --git a/src/7.1/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html b/src/7.1/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html index 9d71efde50..b758dee98d 100644 --- a/src/7.1/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html +++ b/src/7.1/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html @@ -70,7 +70,7 @@

          The serialization format may be YAML, JSON, or any custom format using a custom coder class.

          -

          Keep in mind that database adapters handle certain serialization tasks for you. For instance: json and jsonb types in PostgreSQL will be converted between JSON object/array syntax and Ruby Hash or Array objects transparently. There is no need to use serialize in this case.

          +

          Keep in mind that database adapters handle certain serialization tasks for you. For instance: json and jsonb types in PostgreSQL will be converted between JSON object/array syntax and Ruby Hash or Array objects transparently. There is no need to use serialize in this case.

          For more complex cases, such as conversion to or from your application domain objects, consider using the ActiveRecord::Attributes API.

          @@ -92,7 +92,7 @@

          Parameters

        • yaml - Optional. Yaml specific options. The allowed config is:

          • -

            :permitted_classes - Array with the permitted classes.

            +

            :permitted_classes - Array with the permitted classes.

          • :unsafe_load - Unsafely load YAML blobs, allow YAML to load any class.

          @@ -156,7 +156,7 @@
          Ensure serializ

          Some serialization methods may accept some types they don’t support by silently casting them to other types. This can cause bugs when the data is deserialized.

          -

          For instance the JSON serializer provided in the standard library will silently cast unsupported types to String:

          +

          For instance the JSON serializer provided in the standard library will silently cast unsupported types to String:

          >> JSON.parse(JSON.dump(Struct.new(:foo)))
           => "#<Class:0x000000013090b4c0>"
          @@ -178,7 +178,7 @@ 
          -
          Serialize the preferences Hash using YAML
          +
          Serialize the preferences Hash using YAML
          class User < ActiveRecord::Base
             serialize :preferences, type: Hash, coder: YAML
          diff --git a/src/7.1/classes/ActiveRecord/Attributes/ClassMethods.html b/src/7.1/classes/ActiveRecord/Attributes/ClassMethods.html
          index 043a118487..29ab9f9f7b 100644
          --- a/src/7.1/classes/ActiveRecord/Attributes/ClassMethods.html
          +++ b/src/7.1/classes/ActiveRecord/Attributes/ClassMethods.html
          @@ -307,7 +307,7 @@ 

          This is the low level API which sits beneath attribute. It only accepts type objects, and will do its work immediately instead of waiting for the schema to load. Automatic schema detection and ClassMethods#attribute both call this under the hood. While this method is provided so it can be used by plugin authors, application code should probably use ClassMethods#attribute.

          -

          name The name of the attribute being defined. Expected to be a String.

          +

          name The name of the attribute being defined. Expected to be a String.

          cast_type The type object to use for this attribute.

          diff --git a/src/7.1/classes/ActiveRecord/ConnectionAdapters/AbstractAdapter.html b/src/7.1/classes/ActiveRecord/ConnectionAdapters/AbstractAdapter.html index 73c1f504d5..b83cf92d48 100644 --- a/src/7.1/classes/ActiveRecord/ConnectionAdapters/AbstractAdapter.html +++ b/src/7.1/classes/ActiveRecord/ConnectionAdapters/AbstractAdapter.html @@ -918,7 +918,7 @@

          -

          Override to check all foreign key constraints in a database. The adapter should raise a ActiveRecord::StatementInvalid if foreign key constraints are not met.

          +

          Override to check all foreign key constraints in a database. The adapter should raise a ActiveRecord::StatementInvalid if foreign key constraints are not met.

          diff --git a/src/7.1/classes/ActiveRecord/ConnectionAdapters/AbstractMysqlAdapter.html b/src/7.1/classes/ActiveRecord/ConnectionAdapters/AbstractMysqlAdapter.html index cc63c6a052..40a3f17954 100644 --- a/src/7.1/classes/ActiveRecord/ConnectionAdapters/AbstractMysqlAdapter.html +++ b/src/7.1/classes/ActiveRecord/ConnectionAdapters/AbstractMysqlAdapter.html @@ -741,13 +741,13 @@

          Drops a table from the database.

          -
          :force +
          :force

          Set to :cascade to drop dependent objects as well. Defaults to false.

          -
          :if_exists +
          :if_exists

          Set to true to only drop the table if it exists. Defaults to false.

          -
          :temporary +
          :temporary

          Set to true to drop temporary table. Defaults to false.

          diff --git a/src/7.1/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html b/src/7.1/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html index 73c72499a1..a51094988e 100644 --- a/src/7.1/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html +++ b/src/7.1/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html @@ -39,7 +39,7 @@

          Introduction

          -

          A connection pool synchronizes thread access to a limited number of database connections. The basic idea is that each thread checks out a database connection from the pool, uses that connection, and checks the connection back in. ConnectionPool is completely thread-safe, and will ensure that a connection cannot be used by two threads at the same time, as long as ConnectionPool’s contract is correctly followed. It will also handle cases in which there are more threads than connections: if all connections have been checked out, and a thread tries to checkout a connection anyway, then ConnectionPool will wait until some other thread has checked in a connection, or the checkout_timeout has expired.

          +

          A connection pool synchronizes thread access to a limited number of database connections. The basic idea is that each thread checks out a database connection from the pool, uses that connection, and checks the connection back in. ConnectionPool is completely thread-safe, and will ensure that a connection cannot be used by two threads at the same time, as long as ConnectionPool’s contract is correctly followed. It will also handle cases in which there are more threads than connections: if all connections have been checked out, and a thread tries to checkout a connection anyway, then ConnectionPool will wait until some other thread has checked in a connection, or the checkout_timeout has expired.

          Obtaining (checking out) a connection

          @@ -64,7 +64,7 @@

          Op

        • idle_timeout: number of seconds that a connection will be kept unused in the pool before it is automatically disconnected (default 300 seconds). Set this to zero to keep connections forever.

        • -

          checkout_timeout: number of seconds to wait for a connection to become available before giving up and raising a timeout error (default 5 seconds).

          +

          checkout_timeout: number of seconds to wait for a connection to become available before giving up and raising a timeout error (default 5 seconds).

        @@ -298,7 +298,7 @@

        -

        Creates a new ConnectionPool object. pool_config is a PoolConfig object which describes database connection information (e.g. adapter, host name, username, password, etc), as well as the maximum size for this ConnectionPool.

        +

        Creates a new ConnectionPool object. pool_config is a PoolConfig object which describes database connection information (e.g. adapter, host name, username, password, etc), as well as the maximum size for this ConnectionPool.

        The default ConnectionPool maximum size is 5.

        diff --git a/src/7.1/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html b/src/7.1/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html index 8055ab7c01..ed38dff6c8 100644 --- a/src/7.1/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html +++ b/src/7.1/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html @@ -777,7 +777,7 @@

        -

        Inserts the given fixture into the table. Overridden in adapters that require something beyond a simple insert (e.g. Oracle). Most of adapters should implement insert_fixtures_set that leverages bulk SQL insert. We keep this method to provide fallback for databases like SQLite that do not support bulk inserts.

        +

        Inserts the given fixture into the table. Overridden in adapters that require something beyond a simple insert (e.g. Oracle). Most of adapters should implement insert_fixtures_set that leverages bulk SQL insert. We keep this method to provide fallback for databases like SQLite that do not support bulk inserts.

        diff --git a/src/7.1/classes/ActiveRecord/ConnectionAdapters/PostgreSQL/SchemaStatements.html b/src/7.1/classes/ActiveRecord/ConnectionAdapters/PostgreSQL/SchemaStatements.html index 76452e605f..ad69684b57 100644 --- a/src/7.1/classes/ActiveRecord/ConnectionAdapters/PostgreSQL/SchemaStatements.html +++ b/src/7.1/classes/ActiveRecord/ConnectionAdapters/PostgreSQL/SchemaStatements.html @@ -197,10 +197,10 @@

      The options hash can include the following keys:

      -
      :name +
      :name

      The constraint name. Defaults to excl_rails_<identifier>.

      -
      :deferrable +
      :deferrable

      Specify whether or not the exclusion constraint should be deferrable. Valid values are false or :immediate or :deferred to specify the default behavior. Defaults to false.

      @@ -303,13 +303,13 @@

      The options hash can include the following keys:

      -
      :name +
      :name

      The constraint name. Defaults to uniq_rails_<identifier>.

      -
      :deferrable +
      :deferrable

      Specify whether or not the unique constraint should be deferrable. Valid values are false or :immediate or :deferred to specify the default behavior. Defaults to false.

      -
      :using_index +
      :using_index

      To specify an existing unique index name. Defaults to nil.

      diff --git a/src/7.1/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html b/src/7.1/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html index 36245c52f3..2c0ca07e47 100644 --- a/src/7.1/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html +++ b/src/7.1/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html @@ -891,7 +891,7 @@

      Removes an extension from the database.

      -
      :force +
      :force

      Set to :cascade to drop dependent objects as well. Defaults to false.

      diff --git a/src/7.1/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html b/src/7.1/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html index 90e0f15580..596729931a 100644 --- a/src/7.1/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html +++ b/src/7.1/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html @@ -310,13 +310,13 @@

      The options hash can include the following keys:

      -
      :name +
      :name

      The constraint name. Defaults to chk_rails_<identifier>.

      -
      :if_not_exists +
      :if_not_exists

      Silently ignore if the constraint already exists, rather than raise an error.

      -
      :validate +
      :validate

      (PostgreSQL only) Specify whether or not the constraint should be validated. Defaults to true.

      @@ -525,28 +525,28 @@
      Creatin

      The options hash can include the following keys:

      -
      :column +
      :column

      The foreign key column name on from_table. Defaults to to_table.singularize + "_id". Pass an array to create a composite foreign key.

      -
      :primary_key +
      :primary_key

      The primary key column name on to_table. Defaults to id. Pass an array to create a composite foreign key.

      -
      :name +
      :name

      The constraint name. Defaults to fk_rails_<identifier>.

      -
      :on_delete +
      :on_delete

      Action that happens ON DELETE. Valid values are :nullify, :cascade, and :restrict

      -
      :on_update +
      :on_update

      Action that happens ON UPDATE. Valid values are :nullify, :cascade, and :restrict

      -
      :if_not_exists +
      :if_not_exists

      Specifies if the foreign key already exists to not try to re-add it. This will avoid duplicate column errors.

      -
      :validate +
      :validate

      (PostgreSQL only) Specify whether or not the constraint should be validated. Defaults to true.

      -
      :deferrable +
      :deferrable

      (PostgreSQL only) Specify whether or not the foreign key should be deferrable. Valid values are booleans or :deferred or :immediate to specify the default behavior. Defaults to false.

      @@ -783,19 +783,19 @@

      Adds a reference. The reference column is a bigint by default, the :type option can be used to specify a different type. Optionally adds a _type column, if :polymorphic option is provided.

      The options hash can include the following keys:

      -
      :type +
      :type

      The reference column type. Defaults to :bigint.

      -
      :index +
      :index

      Add an appropriate index. Defaults to true. See add_index for usage of this option.

      -
      :foreign_key +
      :foreign_key

      Add an appropriate foreign key constraint. Defaults to false, pass true to add. In case the join table can’t be inferred from the association pass :to_table with the appropriate table name.

      -
      :polymorphic +
      :polymorphic

      Whether an additional _type column should be added. Defaults to false.

      -
      :null +
      :null

      Whether the column allows nulls. Defaults to true.

      @@ -1189,7 +1189,7 @@

      The options hash can include the following keys:

      -
      :bulk +
      :bulk

      Set this to true to make this a bulk alter query, such as

      @@ -1531,19 +1531,19 @@

      You can pass an options hash which can include the following keys:

      -
      :table_name +
      :table_name

      Sets the table name, overriding the default.

      -
      :column_options +
      :column_options

      Any extra options you want appended to the columns definition.

      -
      :options +
      :options

      Any extra options you want appended to the table definition.

      -
      :temporary +
      :temporary

      Make a temporary table.

      -
      :force +
      :force

      Set to true to drop the table before creating it. Defaults to false.

      @@ -1646,31 +1646,31 @@

      Regular form

      The options hash can include the following keys:

      -
      :id +
      :id

      Whether to automatically add a primary key column. Defaults to true. Join tables for ActiveRecord::Base.has_and_belongs_to_many should set it to false.

      A Symbol can be used to specify the type of the generated primary key column.

      -
      :primary_key +
      :primary_key

      The name of the primary key, if one is to be added automatically. Defaults to id. If :id is false, then this option is ignored.

      If an array is passed, a composite primary key will be created.

      Note that Active Record models will automatically detect their primary key. This can be avoided by using self.primary_key= on the model to define the key explicitly.

      -
      :options +
      :options

      Any extra options you want appended to the table definition.

      -
      :temporary +
      :temporary

      Make a temporary table.

      -
      :force +
      :force

      Set to true to drop the table before creating it. Set to :cascade to drop dependent objects as well. Defaults to false.

      -
      :if_not_exists +
      :if_not_exists

      Set to true to avoid raising an error when the table already exists. Defaults to false.

      -
      :as +
      :as

      SQL to use to generate the table. When this option is used, the block is ignored, as are the :id and :primary_key options.

      @@ -1943,10 +1943,10 @@

      Drops a table from the database.

      -
      :force +
      :force

      Set to :cascade to drop dependent objects as well. Defaults to false.

      -
      :if_exists +
      :if_exists

      Set to true to only drop the table if it exists. Defaults to false.

      @@ -2533,7 +2533,7 @@

      The options hash accepts the same keys as SchemaStatements#add_foreign_key with an addition of

      -
      :to_table +
      :to_table

      The name of the table that contains the referenced primary key.

      diff --git a/src/7.1/classes/ActiveRecord/ConnectionHandling.html b/src/7.1/classes/ActiveRecord/ConnectionHandling.html index 885235a65b..2d18178de9 100644 --- a/src/7.1/classes/ActiveRecord/ConnectionHandling.html +++ b/src/7.1/classes/ActiveRecord/ConnectionHandling.html @@ -384,7 +384,7 @@

      Connects to a role (e.g. writing, reading, or a custom role) and/or shard for the duration of the block. At the end of the block the connection will be returned to the original role / shard.

      -

      If only a role is passed, Active Record will look up the connection based on the requested role. If a non-established role is requested an ActiveRecord::ConnectionNotEstablished error will be raised:

      +

      If only a role is passed, Active Record will look up the connection based on the requested role. If a non-established role is requested an ActiveRecord::ConnectionNotEstablished error will be raised:

      ActiveRecord::Base.connected_to(role: :writing) do
         Dog.create! # creates dog using dog writing connection
      @@ -395,7 +395,7 @@ 

      end

      -

      When swapping to a shard, the role must be passed as well. If a non-existent shard is passed, an ActiveRecord::ConnectionNotEstablished error will be raised.

      +

      When swapping to a shard, the role must be passed as well. If a non-existent shard is passed, an ActiveRecord::ConnectionNotEstablished error will be raised.

      When a shard and role is passed, Active Record will first lookup the role, and then look up the connection by shard key.

      @@ -498,7 +498,7 @@

      Connects a role and/or shard to the provided connection names. Optionally prevent_writes can be passed to block writes on a connection. reading will automatically set prevent_writes to true.

      -

      connected_to_many is an alternative to deeply nested connected_to blocks.

      +

      connected_to_many is an alternative to deeply nested connected_to blocks.

      Usage:

      @@ -557,7 +557,7 @@

      This method is useful for ensuring that a specific connection is being used. For example, when booting a console in readonly mode.

      -

      It is not recommended to use this method in a request since it does not yield to a block like connected_to.

      +

      It is not recommended to use this method in a request since it does not yield to a block like connected_to.

      @@ -755,7 +755,7 @@

      end

      -

      connects_to also supports horizontal sharding. The horizontal sharding API supports read replicas as well. You can connect a model to a list of shards like this:

      +

      connects_to also supports horizontal sharding. The horizontal sharding API supports read replicas as well. You can connect a model to a list of shards like this:

      class AnimalsModel < ApplicationRecord
         self.abstract_class = true
      @@ -1101,7 +1101,7 @@ 

      Prevent writing to the database regardless of role.

      -

      In some cases you may want to prevent writes to the database even if you are on a database that can write. while_preventing_writes will prevent writes to the database for the duration of the block.

      +

      In some cases you may want to prevent writes to the database even if you are on a database that can write. while_preventing_writes will prevent writes to the database for the duration of the block.

      This method does not provide the same protection as a readonly user and is meant to be a safeguard against accidental writes.

      diff --git a/src/7.1/classes/ActiveRecord/Core.html b/src/7.1/classes/ActiveRecord/Core.html index 4114ecd371..10ae234ed8 100644 --- a/src/7.1/classes/ActiveRecord/Core.html +++ b/src/7.1/classes/ActiveRecord/Core.html @@ -615,7 +615,7 @@

      -

      Force enumeration of all columns in SELECT statements. e.g. SELECT first_name, last_name FROM ... instead of SELECT * FROM ... This avoids PreparedStatementCacheExpired errors when a column is added to the database while the app is running.

      +

      Force enumeration of all columns in SELECT statements. e.g. SELECT first_name, last_name FROM ... instead of SELECT * FROM ... This avoids PreparedStatementCacheExpired errors when a column is added to the database while the app is running.

      diff --git a/src/7.1/classes/ActiveRecord/Core/ClassMethods.html b/src/7.1/classes/ActiveRecord/Core/ClassMethods.html index b737496e27..d06a12f92a 100644 --- a/src/7.1/classes/ActiveRecord/Core/ClassMethods.html +++ b/src/7.1/classes/ActiveRecord/Core/ClassMethods.html @@ -70,7 +70,7 @@

      -

      Returns columns which shouldn’t be exposed while calling #inspect.

      +

      Returns columns which shouldn’t be exposed while calling inspect.

      @@ -109,7 +109,7 @@

      -

      Specifies columns which shouldn’t be exposed while calling #inspect.

      +

      Specifies columns which shouldn’t be exposed while calling inspect.

      diff --git a/src/7.1/classes/ActiveRecord/DatabaseConfigurations.html b/src/7.1/classes/ActiveRecord/DatabaseConfigurations.html index 8799b91c18..ffaae38335 100644 --- a/src/7.1/classes/ActiveRecord/DatabaseConfigurations.html +++ b/src/7.1/classes/ActiveRecord/DatabaseConfigurations.html @@ -39,7 +39,7 @@

      Active Record Database Configurations

      -

      ActiveRecord::DatabaseConfigurations returns an array of DatabaseConfig objects that are constructed from the application’s database configuration hash or URL string.

      +

      ActiveRecord::DatabaseConfigurations returns an array of DatabaseConfig objects that are constructed from the application’s database configuration hash or URL string.

      The array of DatabaseConfig objects in an application default to either a HashConfig or UrlConfig. You can retrieve your application’s config by using ActiveRecord::Base.configurations.

      @@ -196,7 +196,7 @@

      end

      -

      For configs that have a :vitess key, a VitessConfig object will be created instead of a UrlConfig.

      +

      For configs that have a :vitess key, a VitessConfig object will be created instead of a UrlConfig.

      @@ -370,7 +370,7 @@

      Returns a single DatabaseConfig object based on the requested environment.

      -

      If the application has multiple databases find_db_config will return the first DatabaseConfig for the environment.

      +

      If the application has multiple databases find_db_config will return the first DatabaseConfig for the environment.

      diff --git a/src/7.1/classes/ActiveRecord/DatabaseConfigurations/HashConfig.html b/src/7.1/classes/ActiveRecord/DatabaseConfigurations/HashConfig.html index 4de0c31e80..515d6e92e4 100644 --- a/src/7.1/classes/ActiveRecord/DatabaseConfigurations/HashConfig.html +++ b/src/7.1/classes/ActiveRecord/DatabaseConfigurations/HashConfig.html @@ -31,7 +31,7 @@

      Active Record Database Hash Config

      -

      A HashConfig object is created for each database configuration entry that is created from a hash.

      +

      A HashConfig object is created for each database configuration entry that is created from a hash.

      A hash config:

      @@ -174,7 +174,7 @@

      -

      Initialize a new HashConfig object

      +

      Initialize a new HashConfig object

      Options

      • @@ -543,7 +543,7 @@

        -

        The migrations paths for a database configuration. If the migrations_paths key is present in the config, migrations_paths will return its value.

        +

        The migrations paths for a database configuration. If the migrations_paths key is present in the config, migrations_paths will return its value.

        @@ -683,7 +683,7 @@

        -

        reaping_frequency is configurable mostly for historical reasons, but it could also be useful if someone wants a very low idle_timeout.

        +

        reaping_frequency is configurable mostly for historical reasons, but it could also be useful if someone wants a very low idle_timeout.

        diff --git a/src/7.1/classes/ActiveRecord/DatabaseConfigurations/UrlConfig.html b/src/7.1/classes/ActiveRecord/DatabaseConfigurations/UrlConfig.html index 8d76b6ab24..3a2e3714fd 100644 --- a/src/7.1/classes/ActiveRecord/DatabaseConfigurations/UrlConfig.html +++ b/src/7.1/classes/ActiveRecord/DatabaseConfigurations/UrlConfig.html @@ -31,7 +31,7 @@

        Active Record Database Url Config

        -

        A UrlConfig object is created for each database configuration entry that is created from a URL. This can either be a URL string or a hash with a URL in place of the config hash.

        +

        A UrlConfig object is created for each database configuration entry that is created from a URL. This can either be a URL string or a hash with a URL in place of the config hash.

        A URL config:

        @@ -108,7 +108,7 @@

        -

        Initialize a new UrlConfig object

        +

        Initialize a new UrlConfig object

        Options

        • diff --git a/src/7.1/classes/ActiveRecord/DelegatedType.html b/src/7.1/classes/ActiveRecord/DelegatedType.html index 1c2973f97d..2bbc6eecf7 100644 --- a/src/7.1/classes/ActiveRecord/DelegatedType.html +++ b/src/7.1/classes/ActiveRecord/DelegatedType.html @@ -236,13 +236,13 @@

          Options

          The options are passed directly to the belongs_to call, so this is where you declare dependent etc. The following options can be included to specialize the behavior of the delegated type convenience methods.

          -
          :foreign_key +
          :foreign_key

          Specify the foreign key used for the convenience methods. By default this is guessed to be the passed role with an “_id” suffix. So a class that defines a delegated_type :entryable, types: %w[ Message Comment ] association will use “entryable_id” as the default :foreign_key.

          -
          :foreign_type +
          :foreign_type

          Specify the column used to store the associated object’s type. By default this is inferred to be the passed role with a “_type” suffix. A class that defines a delegated_type :entryable, types: %w[ Message Comment ] association will use “entryable_type” as the default :foreign_type.

          -
          :primary_key +
          :primary_key

          Specify the method that returns the primary key of associated object used for the convenience methods. By default this is id.

          diff --git a/src/7.1/classes/ActiveRecord/Encryption/Cipher.html b/src/7.1/classes/ActiveRecord/Encryption/Cipher.html index 8988721b61..212c90ba2a 100644 --- a/src/7.1/classes/ActiveRecord/Encryption/Cipher.html +++ b/src/7.1/classes/ActiveRecord/Encryption/Cipher.html @@ -33,11 +33,11 @@

          -

          The algorithm used for encrypting and decrypting Message objects.

          +

          The algorithm used for encrypting and decrypting Message objects.

          It uses AES-256-GCM. It will generate a random IV for non deterministic encryption (default) or derive an initialization vector from the encrypted content for deterministic encryption.

          -

          See Cipher::Aes256Gcm.

          +

          See Cipher::Aes256Gcm.

          @@ -124,9 +124,9 @@

          -

          Decrypt the provided Message.

          +

          Decrypt the provided Message.

          -

          When key is an Array, it will try all the keys raising a ActiveRecord::Encryption::Errors::Decryption if none works.

          +

          When key is an Array, it will try all the keys raising a ActiveRecord::Encryption::Errors::Decryption if none works.

          @@ -163,7 +163,7 @@

          -

          Encrypts the provided text and return an encrypted Message.

          +

          Encrypts the provided text and return an encrypted Message.

          diff --git a/src/7.1/classes/ActiveRecord/Encryption/Cipher/Aes256Gcm.html b/src/7.1/classes/ActiveRecord/Encryption/Cipher/Aes256Gcm.html index c29dd98c82..fee0d4cd49 100644 --- a/src/7.1/classes/ActiveRecord/Encryption/Cipher/Aes256Gcm.html +++ b/src/7.1/classes/ActiveRecord/Encryption/Cipher/Aes256Gcm.html @@ -33,7 +33,7 @@

          By default it will use random initialization vectors. For deterministic encryption, it will use a SHA-256 hash of the text to encrypt and the secret.

          -

          See Encryptor

          +

          See Encryptor

        diff --git a/src/7.1/classes/ActiveRecord/Encryption/Contexts.html b/src/7.1/classes/ActiveRecord/Encryption/Contexts.html index 01366a0450..d75c0c894a 100644 --- a/src/7.1/classes/ActiveRecord/Encryption/Contexts.html +++ b/src/7.1/classes/ActiveRecord/Encryption/Contexts.html @@ -243,7 +243,7 @@

        Configures a custom encryption context to use when running the provided block of code.

        -

        It supports overriding all the properties defined in Context.

        +

        It supports overriding all the properties defined in Context.

        Example:

        diff --git a/src/7.1/classes/ActiveRecord/Encryption/EncryptableRecord.html b/src/7.1/classes/ActiveRecord/Encryption/EncryptableRecord.html index e6cbfd6792..105eea95f6 100644 --- a/src/7.1/classes/ActiveRecord/Encryption/EncryptableRecord.html +++ b/src/7.1/classes/ActiveRecord/Encryption/EncryptableRecord.html @@ -426,7 +426,7 @@

        Options

      • :ignore_case - When true, it behaves like :downcase but, it also preserves the original case in a specially designated column +original_<name>+. When reading the encrypted content, the version with the original case is served. But you can still execute queries that will ignore the case. This option can only be used when :deterministic is true.

      • -

        :context_properties - Additional properties that will override Context settings when this attribute is encrypted and decrypted. E.g: encryptor:, cipher:, message_serializer:, etc.

        +

        :context_properties - Additional properties that will override Context settings when this attribute is encrypted and decrypted. E.g: encryptor:, cipher:, message_serializer:, etc.

      • :previous - List of previous encryption schemes. When provided, they will be used in order when trying to read the attribute. Each entry of the list can contain the properties supported by encrypts. Also, when deterministic encryption is used, they will be used to generate additional ciphertexts to check in the queries.

      diff --git a/src/7.1/classes/ActiveRecord/Encryption/EncryptedAttributeType.html b/src/7.1/classes/ActiveRecord/Encryption/EncryptedAttributeType.html index c0ce4ea8e9..bf1961cd2a 100644 --- a/src/7.1/classes/ActiveRecord/Encryption/EncryptedAttributeType.html +++ b/src/7.1/classes/ActiveRecord/Encryption/EncryptedAttributeType.html @@ -31,7 +31,7 @@

      An ActiveModel::Type::Value that encrypts/decrypts strings of text.

      -

      This is the central piece that connects the encryption system with encrypts declarations in the model classes. Whenever you declare an attribute as encrypted, it configures an EncryptedAttributeType for that attribute.

      +

      This is the central piece that connects the encryption system with encrypts declarations in the model classes. Whenever you declare an attribute as encrypted, it configures an EncryptedAttributeType for that attribute.

      @@ -141,7 +141,7 @@

      Options

      • -

        :scheme - A Scheme with the encryption properties for this attribute.

        +

        :scheme - A Scheme with the encryption properties for this attribute.

      • :cast_type - A type that will be used to serialize (before encrypting) and deserialize (after decrypting). ActiveModel::Type::String by default.

      diff --git a/src/7.1/classes/ActiveRecord/Encryption/Encryptor.html b/src/7.1/classes/ActiveRecord/Encryption/Encryptor.html index 9d66c8f356..6593132602 100644 --- a/src/7.1/classes/ActiveRecord/Encryption/Encryptor.html +++ b/src/7.1/classes/ActiveRecord/Encryption/Encryptor.html @@ -118,10 +118,10 @@

      Decrypts a clean_text and returns the result as clean text

      Options

      -
      :key_provider +
      :key_provider

      Key provider to use for the encryption operation. It will default to ActiveRecord::Encryption.key_provider when not provided

      -
      :cipher_options +
      :cipher_options

      Cipher-specific options that will be passed to the Cipher configured in ActiveRecord::Encryption.cipher

      @@ -178,10 +178,10 @@

    • Options

      -
      :key_provider +
      :key_provider

      Key provider to use for the encryption operation. It will default to ActiveRecord::Encryption.key_provider when not provided.

      -
      :cipher_options +
      :cipher_options

      Cipher-specific options that will be passed to the Cipher configured in ActiveRecord::Encryption.cipher

      diff --git a/src/7.1/classes/ActiveRecord/Encryption/Key.html b/src/7.1/classes/ActiveRecord/Encryption/Key.html index 260a5abac5..c87a6089f2 100644 --- a/src/7.1/classes/ActiveRecord/Encryption/Key.html +++ b/src/7.1/classes/ActiveRecord/Encryption/Key.html @@ -31,7 +31,7 @@

      A key is a container for a given secret

      -

      Optionally, it can include public_tags. These tags are meant to be stored in clean (public) and can be used, for example, to include information that references the key for a future retrieval operation.

      +

      Optionally, it can include public_tags. These tags are meant to be stored in clean (public) and can be used, for example, to include information that references the key for a future retrieval operation.

    diff --git a/src/7.1/classes/ActiveRecord/Encryption/KeyGenerator.html b/src/7.1/classes/ActiveRecord/Encryption/KeyGenerator.html index bc30f64490..e51213e631 100644 --- a/src/7.1/classes/ActiveRecord/Encryption/KeyGenerator.html +++ b/src/7.1/classes/ActiveRecord/Encryption/KeyGenerator.html @@ -142,7 +142,7 @@

    -

    Derives a key from the given password. The key will have a size in bytes of :length (configured Cipher‘s length by default)

    +

    Derives a key from the given password. The key will have a size in bytes of :length (configured Cipher‘s length by default)

    The generated key will be salted with the value of ActiveRecord::Encryption.key_derivation_salt

    @@ -180,7 +180,7 @@

    -

    Returns a random key in hexadecimal format. The key will have a size in bytes of :length (configured Cipher‘s length by default)

    +

    Returns a random key in hexadecimal format. The key will have a size in bytes of :length (configured Cipher‘s length by default)

    Hexadecimal format is handy for representing keys as printable text. To maximize the space of characters used, it is good practice including not printable characters. Hexadecimal format ensures that generated keys are representable with plain text

    @@ -222,7 +222,7 @@

    -

    Returns a random key. The key will have a size in bytes of :length (configured Cipher‘s length by default)

    +

    Returns a random key. The key will have a size in bytes of :length (configured Cipher‘s length by default)

    diff --git a/src/7.1/classes/ActiveRecord/Encryption/KeyProvider.html b/src/7.1/classes/ActiveRecord/Encryption/KeyProvider.html index 36c1841d69..faa1cc65f5 100644 --- a/src/7.1/classes/ActiveRecord/Encryption/KeyProvider.html +++ b/src/7.1/classes/ActiveRecord/Encryption/KeyProvider.html @@ -29,7 +29,7 @@

    -

    A KeyProvider serves keys:

    +

    A KeyProvider serves keys:

    • An encryption key

    • diff --git a/src/7.1/classes/ActiveRecord/Encryption/Properties.html b/src/7.1/classes/ActiveRecord/Encryption/Properties.html index 372f7e8846..2f5910352f 100644 --- a/src/7.1/classes/ActiveRecord/Encryption/Properties.html +++ b/src/7.1/classes/ActiveRecord/Encryption/Properties.html @@ -29,7 +29,7 @@

      -

      This is a wrapper for a hash of encryption properties. It is used by Key (public tags) and Message (headers).

      +

      This is a wrapper for a hash of encryption properties. It is used by Key (public tags) and Message (headers).

      Since properties are serialized in messages, it is important for storage efficiency to keep their keys as short as possible. It defines accessors for common properties that will keep these keys very short while exposing a readable name.

      diff --git a/src/7.1/classes/ActiveRecord/Encryption/ReadOnlyNullEncryptor.html b/src/7.1/classes/ActiveRecord/Encryption/ReadOnlyNullEncryptor.html index 770eda1649..4b0fa93456 100644 --- a/src/7.1/classes/ActiveRecord/Encryption/ReadOnlyNullEncryptor.html +++ b/src/7.1/classes/ActiveRecord/Encryption/ReadOnlyNullEncryptor.html @@ -29,7 +29,7 @@

      -

      A NullEncryptor that will raise an error when trying to encrypt data

      +

      A NullEncryptor that will raise an error when trying to encrypt data

      This is useful when you want to reveal ciphertexts for debugging purposes and you want to make sure you won’t overwrite any encryptable attribute with the wrong content.

      diff --git a/src/7.1/classes/ActiveRecord/Inheritance.html b/src/7.1/classes/ActiveRecord/Inheritance.html index 8c56529245..90f0255c7c 100644 --- a/src/7.1/classes/ActiveRecord/Inheritance.html +++ b/src/7.1/classes/ActiveRecord/Inheritance.html @@ -25,7 +25,7 @@

      Single table inheritance

      -

      Active Record allows inheritance by storing the name of the class in a column that by default is named “type” (can be changed by overwriting Base.inheritance_column). This means that an inheritance looking like this:

      +

      Active Record allows inheritance by storing the name of the class in a column that by default is named “type” (can be changed by overwriting Base.inheritance_column). This means that an inheritance looking like this:

      class Company < ActiveRecord::Base; end
       class Firm < Company; end
      diff --git a/src/7.1/classes/ActiveRecord/Inheritance/ClassMethods.html b/src/7.1/classes/ActiveRecord/Inheritance/ClassMethods.html
      index d0fdd4f879..73b4af5d78 100644
      --- a/src/7.1/classes/ActiveRecord/Inheritance/ClassMethods.html
      +++ b/src/7.1/classes/ActiveRecord/Inheritance/ClassMethods.html
      @@ -96,7 +96,7 @@ 

      Attributes

      [RW] abstract_class -

      Set this to true if this is an abstract class (see abstract_class?). If you are using inheritance with Active Record and don’t want a class to be considered as part of the STI hierarchy, you must set this to true. ApplicationRecord, for example, is generated as an abstract class.

      +

      Set this to true if this is an abstract class (see abstract_class?). If you are using inheritance with Active Record and don’t want a class to be considered as part of the STI hierarchy, you must set this to true. ApplicationRecord, for example, is generated as an abstract class.

      Consider the following default behavior:

      @@ -112,7 +112,7 @@

      Attributes

      Square.create! # => #<Square id: 3, type: "Square">
      -

      However, when using abstract_class, Shape is omitted from the hierarchy:

      +

      However, when using abstract_class, Shape is omitted from the hierarchy:

      class Shape < ActiveRecord::Base
         self.abstract_class = true
      @@ -136,7 +136,7 @@ 

      Attributes

      [R] base_class -

      Returns the first class in the inheritance hierarchy that descends from either an abstract class or from ActiveRecord::Base.

      +

      Returns the first class in the inheritance hierarchy that descends from either an abstract class or from ActiveRecord::Base.

      Consider the following behaviour:

      diff --git a/src/7.1/classes/ActiveRecord/Integration.html b/src/7.1/classes/ActiveRecord/Integration.html index 07d0f72aba..3623f794ac 100644 --- a/src/7.1/classes/ActiveRecord/Integration.html +++ b/src/7.1/classes/ActiveRecord/Integration.html @@ -362,7 +362,7 @@

      -

      Returns a String, which Action Pack uses for constructing a URL to this object. The default implementation returns this record’s id as a String, or nil if this record’s unsaved.

      +

      Returns a String, which Action Pack uses for constructing a URL to this object. The default implementation returns this record’s id as a String, or nil if this record’s unsaved.

      For example, suppose that you have a User model, and that you have a resources :users route. Normally, user_path will construct a path with the user object’s ‘id’ in it:

      @@ -370,7 +370,7 @@

      user_path(user) # => "/users/1"

      -

      You can override to_param in your model to make user_path construct a path using the user’s name instead of the user’s id:

      +

      You can override to_param in your model to make user_path construct a path using the user’s name instead of the user’s id:

      class User < ActiveRecord::Base
         def to_param  # overridden
      diff --git a/src/7.1/classes/ActiveRecord/Integration/ClassMethods.html b/src/7.1/classes/ActiveRecord/Integration/ClassMethods.html
      index 9c964b9fae..571e68214e 100644
      --- a/src/7.1/classes/ActiveRecord/Integration/ClassMethods.html
      +++ b/src/7.1/classes/ActiveRecord/Integration/ClassMethods.html
      @@ -66,7 +66,7 @@ 

      -

      Defines your model’s to_param method to generate “pretty” URLs using method_name, which can be any attribute or method that responds to to_s.

      +

      Defines your model’s to_param method to generate “pretty” URLs using method_name, which can be any attribute or method that responds to to_s.

      class User < ActiveRecord::Base
         to_param :name
      diff --git a/src/7.1/classes/ActiveRecord/IrreversibleMigration.html b/src/7.1/classes/ActiveRecord/IrreversibleMigration.html
      index 5d60bf7e44..59b8c3952d 100644
      --- a/src/7.1/classes/ActiveRecord/IrreversibleMigration.html
      +++ b/src/7.1/classes/ActiveRecord/IrreversibleMigration.html
      @@ -48,7 +48,7 @@ 

      There are two ways to mitigate this problem.

      1. -

        Define #up and #down methods instead of #change:

        +

        Define up and down methods instead of change:

      class ReversibleMigrationExample < ActiveRecord::Migration[7.1]
      @@ -75,7 +75,7 @@ 

      end

      1. -

        Use the reversible method in #change method:

        +

        Use the reversible method in change method:

      class ReversibleMigrationExample < ActiveRecord::Migration[7.1]
      diff --git a/src/7.1/classes/ActiveRecord/Locking/Optimistic.html b/src/7.1/classes/ActiveRecord/Locking/Optimistic.html
      index e7c7fac762..ffb061b244 100644
      --- a/src/7.1/classes/ActiveRecord/Locking/Optimistic.html
      +++ b/src/7.1/classes/ActiveRecord/Locking/Optimistic.html
      @@ -27,11 +27,11 @@ 

      Optimistic locking allows multiple users to access the same record for edits, and assumes a minimum of conflicts with the data. It does this by checking whether another process has made changes to a record since it was opened, an ActiveRecord::StaleObjectError exception is thrown if that has occurred and the update is ignored.

      -

      Check out ActiveRecord::Locking::Pessimistic for an alternative.

      +

      Check out ActiveRecord::Locking::Pessimistic for an alternative.

      Usage

      -

      Active Record supports optimistic locking if the lock_version field is present. Each update to the record increments the integer column lock_version and the locking facilities ensure that records instantiated twice will let the last one saved raise a StaleObjectError if the first was also updated. Example:

      +

      Active Record supports optimistic locking if the lock_version field is present. Each update to the record increments the integer column lock_version and the locking facilities ensure that records instantiated twice will let the last one saved raise a StaleObjectError if the first was also updated. Example:

      p1 = Person.find(1)
       p2 = Person.find(1)
      diff --git a/src/7.1/classes/ActiveRecord/Locking/Optimistic/ClassMethods.html b/src/7.1/classes/ActiveRecord/Locking/Optimistic/ClassMethods.html
      index eadc5a2dbc..9d03f9458d 100644
      --- a/src/7.1/classes/ActiveRecord/Locking/Optimistic/ClassMethods.html
      +++ b/src/7.1/classes/ActiveRecord/Locking/Optimistic/ClassMethods.html
      @@ -141,7 +141,7 @@ 

      -

      Returns true if the lock_optimistically flag is set to true (which it is, by default) and the table includes the locking_column column (defaults to lock_version).

      +

      Returns true if the lock_optimistically flag is set to true (which it is, by default) and the table includes the locking_column column (defaults to lock_version).

      diff --git a/src/7.1/classes/ActiveRecord/Locking/Pessimistic.html b/src/7.1/classes/ActiveRecord/Locking/Pessimistic.html index d0f7fba5c5..d740b3d13c 100644 --- a/src/7.1/classes/ActiveRecord/Locking/Pessimistic.html +++ b/src/7.1/classes/ActiveRecord/Locking/Pessimistic.html @@ -46,7 +46,7 @@

      Pes end

      -

      You can also use ActiveRecord::Base#lock! method to lock one record by id. This may be better if you don’t need to lock every row. Example:

      +

      You can also use ActiveRecord::Base#lock! method to lock one record by id. This may be better if you don’t need to lock every row. Example:

      Account.transaction do
         # select * from accounts where ...
      @@ -63,7 +63,7 @@ 

      Pes end

      -

      You can start a transaction and acquire the lock in one go by calling with_lock with a block. The block is called from within a transaction, the object is already locked. Example:

      +

      You can start a transaction and acquire the lock in one go by calling with_lock with a block. The block is called from within a transaction, the object is already locked. Example:

      account = Account.first
       account.with_lock do
      @@ -75,10 +75,10 @@ 

      Pes

      Database-specific information on row locking:

      -
      MySQL +
      MySQL

      dev.mysql.com/doc/refman/en/innodb-locking-reads.html

      -
      PostgreSQL +
      PostgreSQL

      www.postgresql.org/docs/current/interactive/sql-select.html#SQL-FOR-UPDATE-SHARE

      diff --git a/src/7.1/classes/ActiveRecord/Migration.html b/src/7.1/classes/ActiveRecord/Migration.html index 114baccafb..13391e85d7 100644 --- a/src/7.1/classes/ActiveRecord/Migration.html +++ b/src/7.1/classes/ActiveRecord/Migration.html @@ -244,7 +244,7 @@

      Controlling v

      You can quiet them down by setting ActiveRecord::Migration.verbose = false.

      -

      You can also insert your own messages and benchmarks by using the say_with_time method:

      +

      You can also insert your own messages and benchmarks by using the say_with_time method:

      def up
         ...
      @@ -297,7 +297,7 @@ 

      Reversible Mi

      If a command cannot be reversed, an ActiveRecord::IrreversibleMigration exception will be raised when the migration is moving down.

      -

      For a list of commands that are reversible, please see ActiveRecord::Migration::CommandRecorder.

      +

      For a list of commands that are reversible, please see ActiveRecord::Migration::CommandRecorder.

      Transactional Migrations

      @@ -596,7 +596,7 @@

      Raises ActiveRecord::PendingMigrationError error if any migrations are pending.

      -

      This is deprecated in favor of check_all_pending!

      +

      This is deprecated in favor of check_all_pending!

      diff --git a/src/7.1/classes/ActiveRecord/Migration/CommandRecorder.html b/src/7.1/classes/ActiveRecord/Migration/CommandRecorder.html index a2a95c1869..657b716c7b 100644 --- a/src/7.1/classes/ActiveRecord/Migration/CommandRecorder.html +++ b/src/7.1/classes/ActiveRecord/Migration/CommandRecorder.html @@ -31,7 +31,7 @@

      Migration Command Recorder

      -

      ActiveRecord::Migration::CommandRecorder records commands done during a migration and knows how to reverse those commands. The CommandRecorder knows how to invert the following commands:

      +

      ActiveRecord::Migration::CommandRecorder records commands done during a migration and knows how to reverse those commands. The CommandRecorder knows how to invert the following commands:

      • add_column

      • @@ -272,7 +272,7 @@

        # => [[:add_column, :some_table, :foo, :string], [:add_column, :some_table, :bar, :string]]

      -

      This method will raise an IrreversibleMigration exception if it cannot invert the command.

      +

      This method will raise an IrreversibleMigration exception if it cannot invert the command.

      diff --git a/src/7.1/classes/ActiveRecord/MigrationContext.html b/src/7.1/classes/ActiveRecord/MigrationContext.html index 9b55c58eee..1899d0ffea 100644 --- a/src/7.1/classes/ActiveRecord/MigrationContext.html +++ b/src/7.1/classes/ActiveRecord/MigrationContext.html @@ -33,7 +33,7 @@

      Migration

      MigrationContext sets the context in which a migration is run.

      -

      A migration context requires the path to the migrations is set in the migrations_paths parameter. Optionally a schema_migration class can be provided. Multiple database applications will instantiate a SchemaMigration object per database. From the Rake tasks, Rails will handle this for you.

      +

      A migration context requires the path to the migrations is set in the migrations_paths parameter. Optionally a schema_migration class can be provided. Multiple database applications will instantiate a SchemaMigration object per database. From the Rake tasks, Rails will handle this for you.

      diff --git a/src/7.1/classes/ActiveRecord/ModelSchema.html b/src/7.1/classes/ActiveRecord/ModelSchema.html index b07da64b39..25000d90f6 100644 --- a/src/7.1/classes/ActiveRecord/ModelSchema.html +++ b/src/7.1/classes/ActiveRecord/ModelSchema.html @@ -221,7 +221,7 @@

      The name of the table column which stores the class name on single-table inheritance situations.

      -

      The default inheritance column name is type, which means it’s a reserved word inside Active Record. To be able to use single-table inheritance with another column name, or to use the column type in your own model for something else, you can set inheritance_column:

      +

      The default inheritance column name is type, which means it’s a reserved word inside Active Record. To be able to use single-table inheritance with another column name, or to use the column type in your own model for something else, you can set inheritance_column:

      self.inheritance_column = 'zoink'
       
      @@ -572,7 +572,7 @@

      -

      Works like table_name_prefix=, but appends instead of prepends (set to “_basecamp” gives “projects_basecamp”, “people_basecamp”). By default, the suffix is the empty string.

      +

      Works like table_name_prefix=, but appends instead of prepends (set to “_basecamp” gives “projects_basecamp”, “people_basecamp”). By default, the suffix is the empty string.

      If you are organising your models within modules, you can add a suffix to the models within a namespace by defining a singleton method in the parent module called table_name_suffix which returns your chosen suffix.

      diff --git a/src/7.1/classes/ActiveRecord/NestedAttributes/ClassMethods.html b/src/7.1/classes/ActiveRecord/NestedAttributes/ClassMethods.html index c0a9f5f847..18c631d6aa 100644 --- a/src/7.1/classes/ActiveRecord/NestedAttributes/ClassMethods.html +++ b/src/7.1/classes/ActiveRecord/NestedAttributes/ClassMethods.html @@ -342,16 +342,16 @@

      Defines an attributes writer for the specified association(s).

      Supported options:

      -
      :allow_destroy +
      :allow_destroy

      If true, destroys any members from the attributes hash with a _destroy key and a value that evaluates to true (e.g. 1, ‘1’, true, or ‘true’). This option is false by default.

      -
      :reject_if +
      :reject_if

      Allows you to specify a Proc or a Symbol pointing to a method that checks whether a record should be built for a certain attribute hash. The hash is passed to the supplied Proc or the method and it should return either true or false. When no :reject_if is specified, a record will be built for all attribute hashes that do not have a _destroy value that evaluates to true. Passing :all_blank instead of a Proc will create a proc that will reject a record where all the attributes are blank excluding any value for _destroy.

      -
      :limit +
      :limit

      Allows you to specify the maximum number of associated records that can be processed with the nested attributes. Limit also can be specified as a Proc or a Symbol pointing to a method that should return a number. If the size of the nested attributes array exceeds the specified limit, NestedAttributes::TooManyRecords exception is raised. If omitted, any number of associations can be processed. Note that the :limit option is only applicable to one-to-many associations.

      -
      :update_only +
      :update_only

      For a one-to-one association, this option allows you to specify how nested attributes are going to be used when an associated record already exists. In general, an existing record may either be updated with the new set of attribute values or be replaced by a wholly new record containing those values. By default the :update_only option is false and the nested attributes are used to update the existing record only if they include the record’s :id value. Otherwise a new record will be instantiated and used to replace the existing one. However if the :update_only option is true, the nested attributes are used to update the record’s attributes always, regardless of whether the :id is present. The option is ignored for collection associations.

      diff --git a/src/7.1/classes/ActiveRecord/Persistence.html b/src/7.1/classes/ActiveRecord/Persistence.html index 885619ecec..3e15bd79d4 100644 --- a/src/7.1/classes/ActiveRecord/Persistence.html +++ b/src/7.1/classes/ActiveRecord/Persistence.html @@ -185,7 +185,7 @@

      -

      Returns an instance of the specified klass with the attributes of the current record. This is mostly useful in relation to single table inheritance (STI) structures where you want a subclass to appear as the superclass. This can be used along with record identification in Action Pack to allow, say, Client < Company to do something like render partial: @client.becomes(Company) to render that instance using the companies/company partial instead of clients/client.

      +

      Returns an instance of the specified klass with the attributes of the current record. This is mostly useful in relation to single table inheritance (STI) structures where you want a subclass to appear as the superclass. This can be used along with record identification in Action Pack to allow, say, Client < Company to do something like render client.becomes(Company) at partial: to render that instance using the companies/company partial instead of clients/client.

      Note: The new instance will share a link to the same attributes as the original class. Therefore the STI column value will still be the same. Any change to the attributes on either instance will affect both instances. This includes any attribute initialization done by the new instance.

      diff --git a/src/7.1/classes/ActiveRecord/Persistence/ClassMethods.html b/src/7.1/classes/ActiveRecord/Persistence/ClassMethods.html index 3b524ecd33..e8c0c164e4 100644 --- a/src/7.1/classes/ActiveRecord/Persistence/ClassMethods.html +++ b/src/7.1/classes/ActiveRecord/Persistence/ClassMethods.html @@ -480,12 +480,12 @@

      Returns an ActiveRecord::Result with its contents based on :returning (see below).

      Options

      -
      :returning +
      :returning

      (PostgreSQL and SQLite3 only) An array of attributes to return for all successfully inserted records, which by default is the primary key. Pass returning: %w[ id name ] for both id and name or returning: false to omit the underlying RETURNING SQL clause entirely.

      -

      You can also pass an SQL string if you need more control on the return values (for example, returning: Arel.sql("id, name as new_name")).

      -
      :unique_by +

      You can also pass an SQL string if you need more control on the return values (for example, returning: Arel.sql("id, name as new_name")).

      +
      :unique_by

      (PostgreSQL and SQLite only) By default rows are considered to be unique by every unique index on the table. Any duplicate rows are skipped.

      @@ -499,7 +499,7 @@

      Options

      unique_by: %i[ author_id name ] unique_by: :index_books_on_isbn -
      :record_timestamps +
      :record_timestamps

      By default, automatic setting of timestamp columns is controlled by the model’s record_timestamps config, matching typical behavior.

      @@ -575,12 +575,12 @@

      Returns an ActiveRecord::Result with its contents based on :returning (see below).

      Options

      -
      :returning +
      :returning

      (PostgreSQL and SQLite3 only) An array of attributes to return for all successfully inserted records, which by default is the primary key. Pass returning: %w[ id name ] for both id and name or returning: false to omit the underlying RETURNING SQL clause entirely.

      -

      You can also pass an SQL string if you need more control on the return values (for example, returning: Arel.sql("id, name as new_name")).

      -
      :record_timestamps +

      You can also pass an SQL string if you need more control on the return values (for example, returning: Arel.sql("id, name as new_name")).

      +
      :record_timestamps

      By default, automatic setting of timestamp columns is controlled by the model’s record_timestamps config, matching typical behavior.

      @@ -680,7 +680,7 @@

      -

      Accepts a list of attribute names to be used in the WHERE clause of SELECT / UPDATE / DELETE queries and in the ORDER BY clause for #first and #last finder methods.

      +

      Accepts a list of attribute names to be used in the WHERE clause of SELECT / UPDATE / DELETE queries and in the ORDER BY clause for first and last finder methods.

      class Developer < ActiveRecord::Base
         query_constraints :company_id, :id
      @@ -923,15 +923,15 @@ 

      Returns an ActiveRecord::Result with its contents based on :returning (see below).

      -

      By default, upsert_all will update all the columns that can be updated when there is a conflict. These are all the columns except primary keys, read-only columns, and columns covered by the optional unique_by.

      +

      By default, upsert_all will update all the columns that can be updated when there is a conflict. These are all the columns except primary keys, read-only columns, and columns covered by the optional unique_by.

      Options

      -
      :returning +
      :returning

      (PostgreSQL and SQLite3 only) An array of attributes to return for all successfully inserted records, which by default is the primary key. Pass returning: %w[ id name ] for both id and name or returning: false to omit the underlying RETURNING SQL clause entirely.

      -

      You can also pass an SQL string if you need more control on the return values (for example, returning: Arel.sql("id, name as new_name")).

      -
      :unique_by +

      You can also pass an SQL string if you need more control on the return values (for example, returning: Arel.sql("id, name as new_name")).

      +

      :unique_by

      (PostgreSQL and SQLite only) By default rows are considered to be unique by every unique index on the table. Any duplicate rows are skipped.

      @@ -948,7 +948,7 @@

      Options

      Because it relies on the index information from the database :unique_by is recommended to be paired with Active Record’s schema_cache.

      -
      :on_duplicate +
      :on_duplicate

      Configure the SQL update sentence that will be used in case of conflict.

      @@ -967,9 +967,9 @@

      Options

      See the related :update_only option. Both options can’t be used at the same time.

      -
      :update_only +
      :update_only
      -

      Provide a list of column names that will be updated in case of conflict. If not provided, upsert_all will update all the columns that can be updated. These are all the columns except primary keys, read-only columns, and columns covered by the optional unique_by

      +

      Provide a list of column names that will be updated in case of conflict. If not provided, upsert_all will update all the columns that can be updated. These are all the columns except primary keys, read-only columns, and columns covered by the optional unique_by

      Example:

      @@ -984,7 +984,7 @@

      Options

      See the related :on_duplicate option. Both options can’t be used at the same time.

      -
      :record_timestamps +
      :record_timestamps

      By default, automatic setting of timestamp columns is controlled by the model’s record_timestamps config, matching typical behavior.

      diff --git a/src/7.1/classes/ActiveRecord/Promise.html b/src/7.1/classes/ActiveRecord/Promise.html index bc4c6adbb0..c5754ede86 100644 --- a/src/7.1/classes/ActiveRecord/Promise.html +++ b/src/7.1/classes/ActiveRecord/Promise.html @@ -117,7 +117,7 @@

      -

      Returns a new ActiveRecord::Promise that will apply the passed block when the value is accessed:

      +

      Returns a new ActiveRecord::Promise that will apply the passed block when the value is accessed:

      Post.async_pick(:title).then { |title| title.upcase }.value
       # => "POST TITLE"
      @@ -156,7 +156,7 @@ 

      -

      Returns the query result. If the query wasn’t completed yet, accessing #value will block until the query completes. If the query failed, #value will raise the corresponding error.

      +

      Returns the query result. If the query wasn’t completed yet, accessing value will block until the query completes. If the query failed, value will raise the corresponding error.

      diff --git a/src/7.1/classes/ActiveRecord/QueryLogs.html b/src/7.1/classes/ActiveRecord/QueryLogs.html index 923564b76d..1b3dbda1b1 100644 --- a/src/7.1/classes/ActiveRecord/QueryLogs.html +++ b/src/7.1/classes/ActiveRecord/QueryLogs.html @@ -66,7 +66,7 @@

      Active Re

      job

    -

    New comment tags can be defined by adding them in a Hash to the tags Array. Tags can have dynamic content by setting a Proc or lambda value in the Hash, and can reference any value stored by Rails in the context object. ActiveSupport::CurrentAttributes can be used to store application values. Tags with nil values are omitted from the query comment.

    +

    New comment tags can be defined by adding them in a Hash to the tags Array. Tags can have dynamic content by setting a Proc or lambda value in the Hash, and can reference any value stored by Rails in the context object. ActiveSupport::CurrentAttributes can be used to store application values. Tags with nil values are omitted from the query comment.

    Escaping is performed on the string returned, however untrusted user input should not be used.

    diff --git a/src/7.1/classes/ActiveRecord/QueryMethods.html b/src/7.1/classes/ActiveRecord/QueryMethods.html index 7ca07e95aa..f292618b66 100644 --- a/src/7.1/classes/ActiveRecord/QueryMethods.html +++ b/src/7.1/classes/ActiveRecord/QueryMethods.html @@ -530,7 +530,7 @@

    # SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = 1 AND "comments"."id" != 2 -

    This is short-hand for .where.not(id: post.id) and .where.not(id: [post_one.id, post_two.id]).

    +

    This is short-hand for .where.not(id: post.id) and .where.not(id: [post_one.id, post_two.id]).

    An ArgumentError will be raised if either no records are specified, or if any of the records in the collection (if a collection is passed in) are not instances of the same model that the relation is scoping.

    @@ -1036,7 +1036,7 @@

    # WHERE NOT (`accepted` = 1 AND `locked` = 0) -

    Be careful because this inverts all conditions before invert_where call.

    +

    Be careful because this inverts all conditions before invert_where call.

    class User
       scope :active, -> { where(accepted: true, locked: false) }
    @@ -2431,7 +2431,7 @@ 

    # SELECT * FROM posts JOIN posts_with_tags ON posts_with_tags.id = posts.id

    -

    It is recommended to pass a query as ActiveRecord::Relation. If that is not possible and you have verified it is safe for the database, you can pass it as SQL literal using Arel.

    +

    It is recommended to pass a query as ActiveRecord::Relation. If that is not possible and you have verified it is safe for the database, you can pass it as SQL literal using Arel.

    Post.with(popular_posts: Arel.sql("... complex sql to calculate posts popularity ..."))
     
    diff --git a/src/7.1/classes/ActiveRecord/QueryMethods/WhereChain.html b/src/7.1/classes/ActiveRecord/QueryMethods/WhereChain.html index ee0d3cb388..f63e0cd852 100644 --- a/src/7.1/classes/ActiveRecord/QueryMethods/WhereChain.html +++ b/src/7.1/classes/ActiveRecord/QueryMethods/WhereChain.html @@ -29,7 +29,7 @@

    -

    WhereChain objects act as placeholder for queries in which where does not have any parameter. In this case, where can be chained to return a new relation.

    +

    WhereChain objects act as placeholder for queries in which where does not have any parameter. In this case, where can be chained to return a new relation.

    diff --git a/src/7.1/classes/ActiveRecord/Querying.html b/src/7.1/classes/ActiveRecord/Querying.html index c0da9b7041..ef56c4aed7 100644 --- a/src/7.1/classes/ActiveRecord/Querying.html +++ b/src/7.1/classes/ActiveRecord/Querying.html @@ -78,7 +78,7 @@

    -

    Same as #count_by_sql but perform the query asynchronously and returns an ActiveRecord::Promise.

    +

    Same as count_by_sql but perform the query asynchronously and returns an ActiveRecord::Promise.

    @@ -113,7 +113,7 @@

    -

    Same as #find_by_sql but perform the query asynchronously and returns an ActiveRecord::Promise.

    +

    Same as find_by_sql but perform the query asynchronously and returns an ActiveRecord::Promise.

    diff --git a/src/7.1/classes/ActiveRecord/Reflection/MacroReflection.html b/src/7.1/classes/ActiveRecord/Reflection/MacroReflection.html index 5e73aa536d..36584fdf8a 100644 --- a/src/7.1/classes/ActiveRecord/Reflection/MacroReflection.html +++ b/src/7.1/classes/ActiveRecord/Reflection/MacroReflection.html @@ -186,7 +186,7 @@

    -

    Returns true if self and other_aggregation have the same name attribute, active_record attribute, and other_aggregation has an options hash assigned to it.

    +

    Returns true if self and other_aggregation have the same name attribute, active_record attribute, and other_aggregation has an options hash assigned to it.

    diff --git a/src/7.1/classes/ActiveRecord/Relation.html b/src/7.1/classes/ActiveRecord/Relation.html index 7863a5eb1b..003ae962fc 100644 --- a/src/7.1/classes/ActiveRecord/Relation.html +++ b/src/7.1/classes/ActiveRecord/Relation.html @@ -1577,11 +1577,11 @@

    Post.where(published: true).load_async # => #<ActiveRecord::Relation>
     
    -

    When the Relation is iterated, if the background query wasn’t executed yet, it will be performed by the foreground thread.

    +

    When the Relation is iterated, if the background query wasn’t executed yet, it will be performed by the foreground thread.

    Note that config.active_record.async_query_executor must be configured for queries to actually be executed concurrently. Otherwise it defaults to executing them in the foreground.

    -

    load_async will also fall back to executing in the foreground in the test environment when transactional fixtures are enabled.

    +

    load_async will also fall back to executing in the foreground in the test environment when transactional fixtures are enabled.

    If the query was actually executed in the background, the Active Record logs will show it by prefixing the log line with ASYNC:

    @@ -2269,7 +2269,7 @@

    Parameters

    • -

      updates - A string, array, or hash representing the SET part of an SQL statement. Any strings provided will be type cast, unless you use Arel.sql. (Don’t pass user-provided values to Arel.sql.)

      +

      updates - A string, array, or hash representing the SET part of an SQL statement. Any strings provided will be type cast, unless you use Arel.sql. (Don’t pass user-provided values to Arel.sql.)

    Examples

    diff --git a/src/7.1/classes/ActiveRecord/Scoping/Default/ClassMethods.html b/src/7.1/classes/ActiveRecord/Scoping/Default/ClassMethods.html index 47705e3253..0438f76a2c 100644 --- a/src/7.1/classes/ActiveRecord/Scoping/Default/ClassMethods.html +++ b/src/7.1/classes/ActiveRecord/Scoping/Default/ClassMethods.html @@ -206,7 +206,7 @@

    # DELETE ... FROM `articles` where ID = 1 AND blog_id = 1; -

    (You can also pass any object which responds to call to the default_scope macro, and it will be called when building the default scope.)

    +

    (You can also pass any object which responds to call to the default_scope macro, and it will be called when building the default scope.)

    If you use multiple default_scope declarations in your model then they will be merged together:

    diff --git a/src/7.1/classes/ActiveRecord/SecurePassword/ClassMethods.html b/src/7.1/classes/ActiveRecord/SecurePassword/ClassMethods.html index 6a6f611b6a..ae7fb3cf2c 100644 --- a/src/7.1/classes/ActiveRecord/SecurePassword/ClassMethods.html +++ b/src/7.1/classes/ActiveRecord/SecurePassword/ClassMethods.html @@ -68,7 +68,7 @@

    Given a set of attributes, finds a record using the non-password attributes, and then authenticates that record using the password attributes. Returns the record if authentication succeeds; otherwise, returns nil.

    -

    Regardless of whether a record is found, authenticate_by will cryptographically digest the given password attributes. This behavior helps mitigate timing-based enumeration attacks, wherein an attacker can determine if a passworded record exists even without knowing the password.

    +

    Regardless of whether a record is found, authenticate_by will cryptographically digest the given password attributes. This behavior helps mitigate timing-based enumeration attacks, wherein an attacker can determine if a passworded record exists even without knowing the password.

    Raises an ArgumentError if the set of attributes doesn’t contain at least one password and one non-password attribute.

    diff --git a/src/7.1/classes/ActiveRecord/SecureToken/ClassMethods.html b/src/7.1/classes/ActiveRecord/SecureToken/ClassMethods.html index 980ae09fa6..8f29db9d42 100644 --- a/src/7.1/classes/ActiveRecord/SecureToken/ClassMethods.html +++ b/src/7.1/classes/ActiveRecord/SecureToken/ClassMethods.html @@ -121,15 +121,15 @@

    user.regenerate_auth_token # => true -

    SecureRandom::base58 is used to generate at minimum a 24-character unique token, so collisions are highly unlikely.

    +

    SecureRandom::base58 is used to generate at minimum a 24-character unique token, so collisions are highly unlikely.

    Note that it’s still possible to generate a race condition in the database in the same way that validates_uniqueness_of can. You’re encouraged to add a unique index in the database to deal with this even more unlikely scenario.

    Options

    -
    :length +
    :length

    Length of the Secure Random, with a minimum of 24 characters. It will default to 24.

    -
    :on +
    :on

    The callback when the value is generated. When called with on: :initialize, the value is generated in an after_initialize callback, otherwise the value will be used in a before_ callback. When not specified, :on will use the value of config.active_record.generate_secure_token_on, which defaults to :initialize starting in Rails 7.1.

    diff --git a/src/7.1/classes/ActiveRecord/SignedId.html b/src/7.1/classes/ActiveRecord/SignedId.html index 4911aeb428..e1af36d1b9 100644 --- a/src/7.1/classes/ActiveRecord/SignedId.html +++ b/src/7.1/classes/ActiveRecord/SignedId.html @@ -126,7 +126,7 @@

    -

    Returns a signed id that’s generated using a preconfigured ActiveSupport::MessageVerifier instance. This signed id is tamper proof, so it’s safe to send in an email or otherwise share with the outside world. It can furthermore be set to expire (the default is not to expire), and scoped down with a specific purpose. If the expiration date has been exceeded before find_signed is called, the id won’t find the designated record. If a purpose is set, this too must match.

    +

    Returns a signed id that’s generated using a preconfigured ActiveSupport::MessageVerifier instance. This signed id is tamper proof, so it’s safe to send in an email or otherwise share with the outside world. It can furthermore be set to expire (the default is not to expire), and scoped down with a specific purpose. If the expiration date has been exceeded before find_signed is called, the id won’t find the designated record. If a purpose is set, this too must match.

    If you accidentally let a signed id out in the wild that you wish to retract sooner than its expiration date (or maybe you forgot to set an expiration date while meaning to!), you can use the purpose to essentially version the signed_id, like so:

    diff --git a/src/7.1/classes/ActiveRecord/SignedId/ClassMethods.html b/src/7.1/classes/ActiveRecord/SignedId/ClassMethods.html index e1110bd23c..6c705dab30 100644 --- a/src/7.1/classes/ActiveRecord/SignedId/ClassMethods.html +++ b/src/7.1/classes/ActiveRecord/SignedId/ClassMethods.html @@ -134,7 +134,7 @@

    -

    Works like find_signed, but will raise an ActiveSupport::MessageVerifier::InvalidSignature exception if the signed_id has either expired, has a purpose mismatch, is for another record, or has been tampered with. It will also raise an ActiveRecord::RecordNotFound exception if the valid signed id can’t find a record.

    +

    Works like find_signed, but will raise an ActiveSupport::MessageVerifier::InvalidSignature exception if the signed_id has either expired, has a purpose mismatch, is for another record, or has been tampered with. It will also raise an ActiveRecord::RecordNotFound exception if the valid signed id can’t find a record.

    Examples

    @@ -224,7 +224,7 @@

    -

    Allows you to pass in a custom verifier used for the signed ids. This also allows you to use different verifiers for different classes. This is also helpful if you need to rotate keys, as you can prepare your custom verifier for that in advance. See ActiveSupport::MessageVerifier for details.

    +

    Allows you to pass in a custom verifier used for the signed ids. This also allows you to use different verifiers for different classes. This is also helpful if you need to rotate keys, as you can prepare your custom verifier for that in advance. See ActiveSupport::MessageVerifier for details.

    diff --git a/src/7.1/classes/ActiveRecord/Tasks/DatabaseTasks.html b/src/7.1/classes/ActiveRecord/Tasks/DatabaseTasks.html index d72a748440..6b7e41c91c 100644 --- a/src/7.1/classes/ActiveRecord/Tasks/DatabaseTasks.html +++ b/src/7.1/classes/ActiveRecord/Tasks/DatabaseTasks.html @@ -35,15 +35,15 @@

    Rails.env).

  • -

    database_configuration: configuration of your databases (as in config/database.yml).

    +

    database_configuration: configuration of your databases (as in config/database.yml).

  • -

    db_dir: your db directory.

    +

    db_dir: your db directory.

  • -

    fixtures_path: a path to fixtures directory.

    +

    fixtures_path: a path to fixtures directory.

  • -

    migrations_paths: a list of paths to directories with migrations.

    +

    migrations_paths: a list of paths to directories with migrations.

  • -

    seed_loader: an object which will load seeds, it needs to respond to the load_seed method.

    +

    seed_loader: an object which will load seeds, it needs to respond to the load_seed method.

  • root: a path to the root of the application.

  • diff --git a/src/7.1/classes/ActiveRecord/Timestamp.html b/src/7.1/classes/ActiveRecord/Timestamp.html index bf70f3c08e..a7e67247b9 100644 --- a/src/7.1/classes/ActiveRecord/Timestamp.html +++ b/src/7.1/classes/ActiveRecord/Timestamp.html @@ -39,7 +39,7 @@

    Active Rec

    Time Zone aware attributes

    -

    Active Record keeps all the datetime and time columns timezone aware. By default, these values are stored in the database as UTC and converted back to the current Time.zone when pulled from the database.

    +

    Active Record keeps all the datetime and time columns timezone aware. By default, these values are stored in the database as UTC and converted back to the current Time.zone when pulled from the database.

    This feature can be turned off completely by setting:

    diff --git a/src/7.1/classes/ActiveRecord/Validations/ClassMethods.html b/src/7.1/classes/ActiveRecord/Validations/ClassMethods.html index ef3c2a2f2d..2206d129e3 100644 --- a/src/7.1/classes/ActiveRecord/Validations/ClassMethods.html +++ b/src/7.1/classes/ActiveRecord/Validations/ClassMethods.html @@ -236,7 +236,7 @@

    -

    Validates whether the value of the specified attribute is numeric by trying to convert it to a float with Kernel.Float (if only_integer is false) or applying it to the regular expression /\A[+\-]?\d+\z/ (if only_integer is set to true). Kernel.Float precision defaults to the column’s precision value or 15.

    +

    Validates whether the value of the specified attribute is numeric by trying to convert it to a float with Kernel.Float (if only_integer is false) or applying it to the regular expression /\A[+\-]?\d+\z/ (if only_integer is set to true). Kernel.Float precision defaults to the column’s precision value or 15.

    See ActiveModel::Validations::HelperMethods.validates_numericality_of for more information.

    diff --git a/src/7.1/classes/ActiveStorage.html b/src/7.1/classes/ActiveStorage.html index 1bcb0a9c6e..f9747d1201 100644 --- a/src/7.1/classes/ActiveStorage.html +++ b/src/7.1/classes/ActiveStorage.html @@ -193,9 +193,9 @@

    Active Storage

    Compared to other storage solutions

    -

    A key difference to how Active Storage works compared to other attachment solutions in Rails is through the use of built-in Blob and Attachment models (backed by Active Record). This means existing application models do not need to be modified with additional columns to associate with files. Active Storage uses polymorphic associations via the Attachment join model, which then connects to the actual Blob.

    +

    A key difference to how Active Storage works compared to other attachment solutions in Rails is through the use of built-in Blob and Attachment models (backed by Active Record). This means existing application models do not need to be modified with additional columns to associate with files. Active Storage uses polymorphic associations via the Attachment join model, which then connects to the actual Blob.

    -

    Blob models store attachment metadata (filename, content-type, etc.), and their identifier key in the storage service. Blob models do not store the actual binary data. They are intended to be immutable in spirit. One file, one blob. You can associate the same blob with multiple application models as well. And if you want to do transformations of a given Blob, the idea is that you’ll simply create a new one, rather than attempt to mutate the existing one (though of course you can delete the previous version later if you don’t need it).

    +

    Blob models store attachment metadata (filename, content-type, etc.), and their identifier key in the storage service. Blob models do not store the actual binary data. They are intended to be immutable in spirit. One file, one blob. You can associate the same blob with multiple application models as well. And if you want to do transformations of a given Blob, the idea is that you’ll simply create a new one, rather than attempt to mutate the existing one (though of course you can delete the previous version later if you don’t need it).

    Installation

    diff --git a/src/7.1/classes/ActiveStorage/Attached/Model.html b/src/7.1/classes/ActiveStorage/Attached/Model.html index 28a7dc365f..6f4c5d60c2 100644 --- a/src/7.1/classes/ActiveStorage/Attached/Model.html +++ b/src/7.1/classes/ActiveStorage/Attached/Model.html @@ -106,7 +106,7 @@

    -

    Returns the attachment for the has_one_attached.

    +

    Returns the attachment for the has_one_attached.

    User.last.avatar_attachment
     
    @@ -132,7 +132,7 @@

    -

    Returns the attachments for the has_many_attached.

    +

    Returns the attachments for the has_many_attached.

    Gallery.last.photos_attachments
     
    @@ -158,7 +158,7 @@

    -

    Returns the blob for the has_one_attached attachment.

    +

    Returns the blob for the has_one_attached attachment.

    User.last.avatar_blob
     
    @@ -184,7 +184,7 @@

    -

    Returns the blobs for the has_many_attached attachments.

    +

    Returns the blobs for the has_many_attached attachments.

    Gallery.last.photos_blobs
     
    @@ -226,7 +226,7 @@

    Under the covers, this relationship is implemented as a has_many association to a ActiveStorage::Attachment record and a has_many-through association to a ActiveStorage::Blob record. These associations are available as photos_attachments and photos_blobs. But you shouldn’t need to work with these associations directly in most circumstances.

    -

    The system has been designed to having you go through the ActiveStorage::Attached::Many proxy that provides the dynamic proxy to the associations and factory methods, like #attach.

    +

    The system has been designed to having you go through the ActiveStorage::Attached::Many proxy that provides the dynamic proxy to the associations and factory methods, like attach.

    The :dependent option defaults to :purge_later. This means the attachments will be purged (i.e. destroyed) in the background whenever the record is destroyed. If an ActiveJob::Backend queue adapter is not set in the application set it to purge instead.

    @@ -521,7 +521,7 @@

    User.with_attached_avatar
     
    -

    Use the plural form for has_many_attached:

    +

    Use the plural form for has_many_attached:

    Gallery.with_attached_photos
     
    diff --git a/src/7.1/classes/ActiveStorage/Attachment.html b/src/7.1/classes/ActiveStorage/Attachment.html index a024c4bc01..ac10a3a177 100644 --- a/src/7.1/classes/ActiveStorage/Attachment.html +++ b/src/7.1/classes/ActiveStorage/Attachment.html @@ -207,7 +207,7 @@

    See ActiveStorage::Blob::Representable#preview for more information.

    -

    Raises an ArgumentError if transformations is a Symbol which is an unknown pre-defined variant of the attachment.

    +

    Raises an ArgumentError if transformations is a Symbol which is an unknown pre-defined variant of the attachment.

    @@ -367,7 +367,7 @@

    See ActiveStorage::Blob::Representable#representation for more information.

    -

    Raises an ArgumentError if transformations is a Symbol which is an unknown pre-defined variant of the attachment.

    +

    Raises an ArgumentError if transformations is a Symbol which is an unknown pre-defined variant of the attachment.

    @@ -415,7 +415,7 @@

    See ActiveStorage::Blob::Representable#variant for more information.

    -

    Raises an ArgumentError if transformations is a Symbol which is an unknown pre-defined variant of the attachment.

    +

    Raises an ArgumentError if transformations is a Symbol which is an unknown pre-defined variant of the attachment.

    diff --git a/src/7.1/classes/ActiveStorage/Blob.html b/src/7.1/classes/ActiveStorage/Blob.html index 9c8554fd80..65a3b897bb 100644 --- a/src/7.1/classes/ActiveStorage/Blob.html +++ b/src/7.1/classes/ActiveStorage/Blob.html @@ -41,9 +41,9 @@

    Active Storage Blob

    A blob is a record that contains the metadata about a file and a key for where that file resides on the service. Blobs can be created in two ways:

    1. -

      Ahead of the file being uploaded server-side to the service, via create_and_upload!. A rewindable io with the file contents must be available at the server for this operation.

      +

      Ahead of the file being uploaded server-side to the service, via create_and_upload!. A rewindable io with the file contents must be available at the server for this operation.

    2. -

      Ahead of the file being directly uploaded client-side to the service, via create_before_direct_upload!.

      +

      Ahead of the file being directly uploaded client-side to the service, via create_before_direct_upload!.

    The first option doesn’t require any client-side JavaScript integration, and can be used by any other back-end service that deals with files. The second option is faster, since you’re not using your own server as a staging point for uploads, and can work with deployments like Heroku that do not provide large amounts of disk space.

    @@ -415,7 +415,7 @@

    -

    Works like find_signed, but will raise an ActiveSupport::MessageVerifier::InvalidSignature exception if the signed_id has either expired, has a purpose mismatch, is for another record, or has been tampered with. It will also raise an ActiveRecord::RecordNotFound exception if the valid signed id can’t find a record.

    +

    Works like find_signed, but will raise an ActiveSupport::MessageVerifier::InvalidSignature exception if the signed_id has either expired, has a purpose mismatch, is for another record, or has been tampered with. It will also raise an ActiveRecord::RecordNotFound exception if the valid signed id can’t find a record.

    @@ -1036,7 +1036,7 @@

    -

    Returns a Hash of headers for service_url_for_direct_upload requests.

    +

    Returns a Hash of headers for service_url_for_direct_upload requests.

    @@ -1180,7 +1180,7 @@

    Prior to uploading, we compute the checksum, which is sent to the service for transit integrity validation. If the checksum does not match what the service receives, an exception will be raised. We also measure the size of the io and store that in byte_size on the blob record. The content type is automatically extracted from the io unless you specify a content_type and pass identify as false.

    -

    Normally, you do not have to call this method directly at all. Use the create_and_upload! class method instead. If you do use this method directly, make sure you are using it on a persisted Blob as otherwise another blob’s data might get overwritten on the service.

    +

    Normally, you do not have to call this method directly at all. Use the create_and_upload! class method instead. If you do use this method directly, make sure you are using it on a persisted Blob as otherwise another blob’s data might get overwritten on the service.

    diff --git a/src/7.1/classes/ActiveStorage/Blob/Analyzable.html b/src/7.1/classes/ActiveStorage/Blob/Analyzable.html index e30612f9a0..c59141c5d5 100644 --- a/src/7.1/classes/ActiveStorage/Blob/Analyzable.html +++ b/src/7.1/classes/ActiveStorage/Blob/Analyzable.html @@ -84,7 +84,7 @@

    To choose the analyzer for a blob, Active Storage calls accept? on each registered analyzer in order. It uses the first analyzer for which accept? returns true when given the blob. If no registered analyzer accepts the blob, no metadata is extracted from it.

    -

    In a Rails application, add or remove analyzers by manipulating Rails.application.config.active_storage.analyzers in an initializer:

    +

    In a Rails application, add or remove analyzers by manipulating Rails.application.config.active_storage.analyzers in an initializer:

    # Add a custom analyzer for Microsoft Office documents:
     Rails.application.config.active_storage.analyzers.append DOCXAnalyzer
    diff --git a/src/7.1/classes/ActiveStorage/Preview.html b/src/7.1/classes/ActiveStorage/Preview.html
    index 9e2c53197f..440040cce3 100644
    --- a/src/7.1/classes/ActiveStorage/Preview.html
    +++ b/src/7.1/classes/ActiveStorage/Preview.html
    @@ -35,7 +35,7 @@ 

    Active Storag

    A previewer extracts a preview image from a blob. Active Storage provides previewers for videos and PDFs. ActiveStorage::Previewer::VideoPreviewer is used for videos whereas ActiveStorage::Previewer::PopplerPDFPreviewer and ActiveStorage::Previewer::MuPDFPreviewer are used for PDFs. Build custom previewers by subclassing ActiveStorage::Previewer and implementing the requisite methods. Consult the ActiveStorage::Previewer documentation for more details on what’s required of previewers.

    -

    To choose the previewer for a blob, Active Storage calls accept? on each registered previewer in order. It uses the first previewer for which accept? returns true when given the blob. In a Rails application, add or remove previewers by manipulating Rails.application.config.active_storage.previewers in an initializer:

    +

    To choose the previewer for a blob, Active Storage calls accept? on each registered previewer in order. It uses the first previewer for which accept? returns true when given the blob. In a Rails application, add or remove previewers by manipulating Rails.application.config.active_storage.previewers in an initializer:

    Rails.application.config.active_storage.previewers
     # => [ ActiveStorage::Previewer::PopplerPDFPreviewer, ActiveStorage::Previewer::MuPDFPreviewer, ActiveStorage::Previewer::VideoPreviewer ]
    @@ -304,7 +304,7 @@ 

    -

    Processes the preview if it has not been processed yet. Returns the receiving ActiveStorage::Preview instance for convenience:

    +

    Processes the preview if it has not been processed yet. Returns the receiving ActiveStorage::Preview instance for convenience:

    blob.preview(resize_to_limit: [100, 100]).processed.url
     
    diff --git a/src/7.1/classes/ActiveStorage/Service.html b/src/7.1/classes/ActiveStorage/Service.html index d89511cf9a..16d85a9931 100644 --- a/src/7.1/classes/ActiveStorage/Service.html +++ b/src/7.1/classes/ActiveStorage/Service.html @@ -464,7 +464,7 @@

    -

    Returns a Hash of headers for url_for_direct_upload requests.

    +

    Returns a Hash of headers for url_for_direct_upload requests.

    diff --git a/src/7.1/classes/ActiveStorage/Variation.html b/src/7.1/classes/ActiveStorage/Variation.html index 9e754341a5..9bb50e3cc0 100644 --- a/src/7.1/classes/ActiveStorage/Variation.html +++ b/src/7.1/classes/ActiveStorage/Variation.html @@ -171,7 +171,7 @@

    -

    Returns a signed key for the transformations, which can be used to refer to a specific variation in a URL or combined key (like ActiveStorage::Variant#key).

    +

    Returns a signed key for the transformations, which can be used to refer to a specific variation in a URL or combined key (like ActiveStorage::Variant#key).

    diff --git a/src/7.1/classes/ActiveSupport/ActionableError.html b/src/7.1/classes/ActiveSupport/ActionableError.html index 375d209b81..47ccb6a41b 100644 --- a/src/7.1/classes/ActiveSupport/ActionableError.html +++ b/src/7.1/classes/ActiveSupport/ActionableError.html @@ -27,7 +27,7 @@

    Actionabl

    Actionable errors lets you define actions to resolve an error.

    -

    To make an error actionable, include the ActiveSupport::ActionableError module and invoke the action class macro to define the action. An action needs a name and a block to execute.

    +

    To make an error actionable, include the ActiveSupport::ActionableError module and invoke the action class macro to define the action. An action needs a name and a block to execute.

    diff --git a/src/7.1/classes/ActiveSupport/ArrayInquirer.html b/src/7.1/classes/ActiveSupport/ArrayInquirer.html index 74934fb62d..cfc6090662 100644 --- a/src/7.1/classes/ActiveSupport/ArrayInquirer.html +++ b/src/7.1/classes/ActiveSupport/ArrayInquirer.html @@ -31,7 +31,7 @@

    Array Inquirer

    -

    Wrapping an array in an ArrayInquirer gives a friendlier way to check its string-like contents:

    +

    Wrapping an array in an ArrayInquirer gives a friendlier way to check its string-like contents:

    variants = ActiveSupport::ArrayInquirer.new([:phone, :tablet])
     
    diff --git a/src/7.1/classes/ActiveSupport/Cache/FileStore.html b/src/7.1/classes/ActiveSupport/Cache/FileStore.html
    index 546060138e..14080e69ec 100644
    --- a/src/7.1/classes/ActiveSupport/Cache/FileStore.html
    +++ b/src/7.1/classes/ActiveSupport/Cache/FileStore.html
    @@ -265,7 +265,7 @@ 

    -

    Deletes all items from the cache. In this case it deletes all the entries in the specified file store directory except for .keep or .gitkeep. Be careful which directory is specified in your config file when using FileStore because everything in that directory will be deleted.

    +

    Deletes all items from the cache. In this case it deletes all the entries in the specified file store directory except for .keep or .gitkeep. Be careful which directory is specified in your config file when using FileStore because everything in that directory will be deleted.

    diff --git a/src/7.1/classes/ActiveSupport/Cache/MemCacheStore.html b/src/7.1/classes/ActiveSupport/Cache/MemCacheStore.html index 62e7527081..d7478212ac 100644 --- a/src/7.1/classes/ActiveSupport/Cache/MemCacheStore.html +++ b/src/7.1/classes/ActiveSupport/Cache/MemCacheStore.html @@ -37,10 +37,10 @@

    M

    Special features:

    • -

      Clustering and load balancing. One can specify multiple memcached servers, and MemCacheStore will load balance between all available servers. If a server goes down, then MemCacheStore will ignore it until it comes back up.

      +

      Clustering and load balancing. One can specify multiple memcached servers, and MemCacheStore will load balance between all available servers. If a server goes down, then MemCacheStore will ignore it until it comes back up.

    -

    MemCacheStore implements the Strategy::LocalCache strategy which implements an in-memory cache inside of a block.

    +

    MemCacheStore implements the Strategy::LocalCache strategy which implements an in-memory cache inside of a block.

    @@ -161,12 +161,12 @@

    -

    Creates a new MemCacheStore object, with the given memcached server addresses. Each address is either a host name, or a host-with-port string in the form of “host_name:port”. For example:

    +

    Creates a new MemCacheStore object, with the given memcached server addresses. Each address is either a host name, or a host-with-port string in the form of “host_name:port”. For example:

    ActiveSupport::Cache::MemCacheStore.new("localhost", "server-downstairs.localnetwork:8229")
     
    -

    If no addresses are provided, but ENV['MEMCACHE_SERVERS'] is defined, it will be used instead. Otherwise, MemCacheStore will connect to localhost:11211 (the default memcached port). Passing a Dalli::Client instance is deprecated and will be removed. Please pass an address instead.

    +

    If no addresses are provided, but ENV['MEMCACHE_SERVERS'] is defined, it will be used instead. Otherwise, MemCacheStore will connect to localhost:11211 (the default memcached port). Passing a Dalli::Client instance is deprecated and will be removed. Please pass an address instead.

    diff --git a/src/7.1/classes/ActiveSupport/Cache/MemoryStore.html b/src/7.1/classes/ActiveSupport/Cache/MemoryStore.html index f4823a2f75..30774e4f32 100644 --- a/src/7.1/classes/ActiveSupport/Cache/MemoryStore.html +++ b/src/7.1/classes/ActiveSupport/Cache/MemoryStore.html @@ -35,9 +35,9 @@

    Memory

    This cache has a bounded size specified by the :size options to the initializer (default is 32Mb). When the cache exceeds the allotted size, a cleanup will occur which tries to prune the cache down to three quarters of the maximum size by removing the least recently used entries.

    -

    Unlike other Cache store implementations, MemoryStore does not compress values by default. MemoryStore does not benefit from compression as much as other Store implementations, as it does not send data over a network. However, when compression is enabled, it still pays the full cost of compression in terms of cpu use.

    +

    Unlike other Cache store implementations, MemoryStore does not compress values by default. MemoryStore does not benefit from compression as much as other Store implementations, as it does not send data over a network. However, when compression is enabled, it still pays the full cost of compression in terms of cpu use.

    -

    MemoryStore is thread-safe.

    +

    MemoryStore is thread-safe.

    diff --git a/src/7.1/classes/ActiveSupport/Cache/RedisCacheStore.html b/src/7.1/classes/ActiveSupport/Cache/RedisCacheStore.html index 9bf472723a..474406ebbe 100644 --- a/src/7.1/classes/ActiveSupport/Cache/RedisCacheStore.html +++ b/src/7.1/classes/ActiveSupport/Cache/RedisCacheStore.html @@ -43,9 +43,9 @@

    Red
  • Local cache. Hot in-memory primary cache within block/middleware scope.

  • -

    read_multi and write_multi support for Redis mget/mset. Use Redis::Distributed 4.0.1+ for distributed mget support.

    +

    read_multi and write_multi support for Redis mget/mset. Use Redis::Distributed 4.0.1+ for distributed mget support.

  • -

    delete_matched support for Redis KEYS globs.

    +

    delete_matched support for Redis KEYS globs.

  • diff --git a/src/7.1/classes/ActiveSupport/Cache/Store.html b/src/7.1/classes/ActiveSupport/Cache/Store.html index 0a2d27c237..27e2c6275f 100644 --- a/src/7.1/classes/ActiveSupport/Cache/Store.html +++ b/src/7.1/classes/ActiveSupport/Cache/Store.html @@ -35,7 +35,7 @@

    Acti

    Some implementations may not support all methods beyond the basic cache methods of fetch, write, read, exist?, and delete.

    -

    ActiveSupport::Cache::Store can store any Ruby object that is supported by its coder‘s dump and load methods.

    +

    ActiveSupport::Cache::Store can store any Ruby object that is supported by its coder‘s dump and load methods.

    cache = ActiveSupport::Cache::MemoryStore.new
     
    @@ -206,17 +206,17 @@ 

    Creates a new cache.

    Options

    -
    :namespace +
    :namespace

    Sets the namespace for the cache. This option is especially useful if your application shares a cache with other applications.

    -
    :serializer +
    :serializer

    The serializer for cached values. Must respond to dump and load.

    The default serializer depends on the cache format version (set via config.active_support.cache_format_version when using Rails). The default serializer for each format version includes a fallback mechanism to deserialize values from any format version. This behavior makes it easy to migrate between format versions without invalidating the entire cache.

    You can also specify serializer: :message_pack to use a preconfigured serializer based on ActiveSupport::MessagePack. The :message_pack serializer includes the same deserialization fallback mechanism, allowing easy migration from (or to) the default serializer. The :message_pack serializer may improve performance, but it requires the msgpack gem.

    -
    :compressor +
    :compressor

    The compressor for serialized cache values. Must respond to deflate and inflate.

    @@ -238,7 +238,7 @@

    Options

    ActiveSupport::Cache.lookup_store(:redis_cache_store, compressor: MyCompressor)
    -
    :coder +
    :coder

    The coder for serializing and (optionally) compressing cache entries. Must respond to dump and load.

    diff --git a/src/7.1/classes/ActiveSupport/Cache/WriteOptions.html b/src/7.1/classes/ActiveSupport/Cache/WriteOptions.html index ed785a3483..f4bfd3c12a 100644 --- a/src/7.1/classes/ActiveSupport/Cache/WriteOptions.html +++ b/src/7.1/classes/ActiveSupport/Cache/WriteOptions.html @@ -29,7 +29,7 @@

    -

    Enables the dynamic configuration of Cache entry options while ensuring that conflicting options are not both set. When a block is given to ActiveSupport::Cache::Store#fetch, the second argument will be an instance of WriteOptions.

    +

    Enables the dynamic configuration of Cache entry options while ensuring that conflicting options are not both set. When a block is given to ActiveSupport::Cache::Store#fetch, the second argument will be an instance of WriteOptions.

    @@ -133,7 +133,7 @@

    -

    Sets the Cache entry’s expires_at value. If an expires_in option was previously set, this will unset it since expires_at and expires_in cannot both be set.

    +

    Sets the Cache entry’s expires_at value. If an expires_in option was previously set, this will unset it since expires_at and expires_in cannot both be set.

    @@ -204,7 +204,7 @@

    -

    Sets the Cache entry’s expires_in value. If an expires_at option was previously set, this will unset it since expires_in and expires_at cannot both be set.

    +

    Sets the Cache entry’s expires_in value. If an expires_at option was previously set, this will unset it since expires_in and expires_at cannot both be set.

    diff --git a/src/7.1/classes/ActiveSupport/Callbacks.html b/src/7.1/classes/ActiveSupport/Callbacks.html index e5c31ce1e3..a98e907b4e 100644 --- a/src/7.1/classes/ActiveSupport/Callbacks.html +++ b/src/7.1/classes/ActiveSupport/Callbacks.html @@ -27,7 +27,7 @@

    Active S

    Callbacks are code hooks that are run at key points in an object’s life cycle. The typical use case is to have a base class define a set of callbacks relevant to the other functionality it supplies, so that subclasses can install callbacks that enhance or modify the base functionality without needing to override or redefine methods of the base class.

    -

    Mixing in this module allows you to define the events in the object’s life cycle that will support callbacks (via ClassMethods#define_callbacks), set the instance methods, procs, or callback objects to be called (via ClassMethods#set_callback), and run the installed callbacks at the appropriate times (via run_callbacks).

    +

    Mixing in this module allows you to define the events in the object’s life cycle that will support callbacks (via ClassMethods#define_callbacks), set the instance methods, procs, or callback objects to be called (via ClassMethods#set_callback), and run the installed callbacks at the appropriate times (via run_callbacks).

    By default callbacks are halted by throwing :abort. See ClassMethods#define_callbacks for details.

    diff --git a/src/7.1/classes/ActiveSupport/Callbacks/ClassMethods.html b/src/7.1/classes/ActiveSupport/Callbacks/ClassMethods.html index 30a931212d..818a577cf9 100644 --- a/src/7.1/classes/ActiveSupport/Callbacks/ClassMethods.html +++ b/src/7.1/classes/ActiveSupport/Callbacks/ClassMethods.html @@ -140,9 +140,9 @@

    Options
    Notes
    -

    names passed to define_callbacks must not end with !, ? or =.

    +

    names passed to define_callbacks must not end with !, ? or =.

    -

    Calling define_callbacks multiple times with the same names will overwrite previous callbacks registered with set_callback.

    +

    Calling define_callbacks multiple times with the same names will overwrite previous callbacks registered with set_callback.

    @@ -324,7 +324,7 @@

    Skip a previously set callback. Like set_callback, :if or :unless options may be passed in order to control when the callback is skipped.

    -

    Note: this example uses PersonRecord and #saving_message, which you can see defined here

    +

    Note: this example uses PersonRecord and saving_message, which you can see defined here

    class Writer < PersonRecord
       attr_accessor :age
    diff --git a/src/7.1/classes/ActiveSupport/Concern.html b/src/7.1/classes/ActiveSupport/Concern.html
    index 1b13818252..3d311f5ec3 100644
    --- a/src/7.1/classes/ActiveSupport/Concern.html
    +++ b/src/7.1/classes/ActiveSupport/Concern.html
    @@ -41,7 +41,7 @@ 

    Active Suppo end

    -

    By using ActiveSupport::Concern the above module could instead be written as:

    +

    By using ActiveSupport::Concern the above module could instead be written as:

    require "active_support/concern"
     
    @@ -96,7 +96,7 @@ 

    Active Suppo end

    -

    Unfortunately this won’t work, since when Foo is included, its base is the Bar module, not the Host class. With ActiveSupport::Concern, module dependencies are properly resolved:

    +

    Unfortunately this won’t work, since when Foo is included, its base is the Bar module, not the Host class. With ActiveSupport::Concern, module dependencies are properly resolved:

    require "active_support/concern"
     
    diff --git a/src/7.1/classes/ActiveSupport/Concurrency/ShareLock.html b/src/7.1/classes/ActiveSupport/Concurrency/ShareLock.html
    index 442b8e84fc..2b35a93edf 100644
    --- a/src/7.1/classes/ActiveSupport/Concurrency/ShareLock.html
    +++ b/src/7.1/classes/ActiveSupport/Concurrency/ShareLock.html
    @@ -168,7 +168,7 @@ 

    Execute the supplied block while holding the Exclusive lock. If no_wait is set and the lock is not immediately available, returns nil without yielding. Otherwise, returns the result of the block.

    -

    See start_exclusive for other options.

    +

    See start_exclusive for other options.

    diff --git a/src/7.1/classes/ActiveSupport/Dependencies/RequireDependency.html b/src/7.1/classes/ActiveSupport/Dependencies/RequireDependency.html index 4c3af03ba2..4675a41c6f 100644 --- a/src/7.1/classes/ActiveSupport/Dependencies/RequireDependency.html +++ b/src/7.1/classes/ActiveSupport/Dependencies/RequireDependency.html @@ -68,7 +68,7 @@

    Warning: This method is obsolete. The semantics of the autoloader match Ruby’s and you do not need to be defensive with load order anymore. Just refer to classes and modules normally.

    -

    Engines that do not control the mode in which their parent application runs should call require_dependency where needed in case the runtime mode is :classic.

    +

    Engines that do not control the mode in which their parent application runs should call require_dependency where needed in case the runtime mode is :classic.

    diff --git a/src/7.1/classes/ActiveSupport/Deprecation/Behavior.html b/src/7.1/classes/ActiveSupport/Deprecation/Behavior.html index 4c4c5ec120..bf74d5e5ad 100644 --- a/src/7.1/classes/ActiveSupport/Deprecation/Behavior.html +++ b/src/7.1/classes/ActiveSupport/Deprecation/Behavior.html @@ -24,22 +24,22 @@

    Behavior module allows to determine how to display deprecation messages. You can create a custom behavior or set any from the DEFAULT_BEHAVIORS constant. Available behaviors are:

    -
    :raise +
    :raise

    Raise ActiveSupport::DeprecationException.

    -
    :stderr +
    :stderr

    Log all deprecation warnings to $stderr.

    -
    :log +
    :log
    -

    Log all deprecation warnings to Rails.logger.

    -
    :notify +

    Log all deprecation warnings to Rails.logger.

    +
    :notify

    Use ActiveSupport::Notifications to notify deprecation.rails.

    -
    :report +
    :report

    Use ActiveSupport::ErrorReporter to report deprecations.

    -
    :silence +
    :silence

    Do nothing. On Rails, set config.active_support.report_deprecations = false to disable all behaviors.

    @@ -157,22 +157,22 @@

    Sets the behavior to the specified value. Can be a single value, array, or an object that responds to call.

    Available behaviors:

    -
    :raise +
    :raise

    Raise ActiveSupport::DeprecationException.

    -
    :stderr +
    :stderr

    Log all deprecation warnings to $stderr.

    -
    :log +
    :log
    -

    Log all deprecation warnings to Rails.logger.

    -
    :notify +

    Log all deprecation warnings to Rails.logger.

    +
    :notify

    Use ActiveSupport::Notifications to notify deprecation.rails.

    -
    :report +
    :report

    Use ActiveSupport::ErrorReporter to report deprecations.

    -
    :silence +
    :silence

    Do nothing.

    diff --git a/src/7.1/classes/ActiveSupport/Deprecation/DeprecatedConstantAccessor.html b/src/7.1/classes/ActiveSupport/Deprecation/DeprecatedConstantAccessor.html index 6d1c665beb..c6ed354ae9 100644 --- a/src/7.1/classes/ActiveSupport/Deprecation/DeprecatedConstantAccessor.html +++ b/src/7.1/classes/ActiveSupport/Deprecation/DeprecatedConstantAccessor.html @@ -23,7 +23,7 @@

    -

    DeprecatedConstantAccessor transforms a constant into a deprecated one by hooking const_missing.

    +

    DeprecatedConstantAccessor transforms a constant into a deprecated one by hooking const_missing.

    It takes the names of an old (deprecated) constant and of a new constant (both in string form) and a deprecator.

    diff --git a/src/7.1/classes/ActiveSupport/DescendantsTracker.html b/src/7.1/classes/ActiveSupport/DescendantsTracker.html index 667f9733f8..1ec64cfc6b 100644 --- a/src/7.1/classes/ActiveSupport/DescendantsTracker.html +++ b/src/7.1/classes/ActiveSupport/DescendantsTracker.html @@ -27,7 +27,7 @@

    ActiveSupport::DescendantsTracker does not provide any benefit.

    diff --git a/src/7.1/classes/ActiveSupport/Duration.html b/src/7.1/classes/ActiveSupport/Duration.html index 6a38422f4f..493d22fc97 100644 --- a/src/7.1/classes/ActiveSupport/Duration.html +++ b/src/7.1/classes/ActiveSupport/Duration.html @@ -364,7 +364,7 @@

    Creates a new Duration from string formatted according to ISO 8601 Duration.

    -

    See ISO 8601 for more information. This method allows negative parts to be present in pattern. If invalid string is provided, it will raise ActiveSupport::Duration::ISO8601Parser::ParsingError.

    +

    See ISO 8601 for more information. This method allows negative parts to be present in pattern. If invalid string is provided, it will raise ActiveSupport::Duration::ISO8601Parser::ParsingError.

    diff --git a/src/7.1/classes/ActiveSupport/EncryptedConfiguration.html b/src/7.1/classes/ActiveSupport/EncryptedConfiguration.html index 21c5cac78a..ea54ea4d2b 100644 --- a/src/7.1/classes/ActiveSupport/EncryptedConfiguration.html +++ b/src/7.1/classes/ActiveSupport/EncryptedConfiguration.html @@ -33,7 +33,7 @@

    EncryptedFile to access values stored as encrypted YAML.

    -

    Values can be accessed via Hash methods, such as fetch and dig, or via dynamic accessor methods, similar to OrderedOptions.

    +

    Values can be accessed via Hash methods, such as fetch and dig, or via dynamic accessor methods, similar to OrderedOptions.

    my_config = ActiveSupport::EncryptedConfiguration.new(...)
     my_config.read # => "some_secret: 123\nsome_namespace:\n  another_secret: 456"
    diff --git a/src/7.1/classes/ActiveSupport/EncryptedFile.html b/src/7.1/classes/ActiveSupport/EncryptedFile.html
    index 84561a85c1..32d57faa36 100644
    --- a/src/7.1/classes/ActiveSupport/EncryptedFile.html
    +++ b/src/7.1/classes/ActiveSupport/EncryptedFile.html
    @@ -274,7 +274,7 @@ 

    -

    Returns the encryption key, first trying the environment variable specified by env_key, then trying the key file specified by key_path. If raise_if_missing_key is true, raises MissingKeyError if the environment variable is not set and the key file does not exist.

    +

    Returns the encryption key, first trying the environment variable specified by env_key, then trying the key file specified by key_path. If raise_if_missing_key is true, raises MissingKeyError if the environment variable is not set and the key file does not exist.

    @@ -309,7 +309,7 @@

    -

    Returns truthy if key is truthy. Returns falsy otherwise. Unlike key, does not raise MissingKeyError when raise_if_missing_key is true.

    +

    Returns truthy if key is truthy. Returns falsy otherwise. Unlike key, does not raise MissingKeyError when raise_if_missing_key is true.

    @@ -348,7 +348,7 @@

    Raises:

    • -

      MissingKeyError if the key is missing and raise_if_missing_key is true.

      +

      MissingKeyError if the key is missing and raise_if_missing_key is true.

    • MissingContentError if the encrypted file does not exist or otherwise if the key is missing.

    • diff --git a/src/7.1/classes/ActiveSupport/ErrorReporter.html b/src/7.1/classes/ActiveSupport/ErrorReporter.html index ae5932950f..2682e11cab 100644 --- a/src/7.1/classes/ActiveSupport/ErrorReporter.html +++ b/src/7.1/classes/ActiveSupport/ErrorReporter.html @@ -33,7 +33,7 @@

      Active Support Error Reporter

      -

      ActiveSupport::ErrorReporter is a common interface for error reporting services.

      +

      ActiveSupport::ErrorReporter is a common interface for error reporting services.

      To rescue and report any unhandled error, you can use the handle method:

      diff --git a/src/7.1/classes/ActiveSupport/ExecutionWrapper.html b/src/7.1/classes/ActiveSupport/ExecutionWrapper.html index 0500c5a774..9e6d148e34 100644 --- a/src/7.1/classes/ActiveSupport/ExecutionWrapper.html +++ b/src/7.1/classes/ActiveSupport/ExecutionWrapper.html @@ -107,7 +107,7 @@

      Register an object to be invoked during both the run and complete steps.

      -

      hook.complete will be passed the value returned from hook.run, and will only be invoked if run has previously been called. (Mostly, this means it won’t be invoked if an exception occurs in a preceding to_run block; all ordinary to_complete blocks are invoked in that situation.)

      +

      hook.complete will be passed the value returned from hook.run, and will only be invoked if run has previously been called. (Mostly, this means it won’t be invoked if an exception occurs in a preceding to_run block; all ordinary to_complete blocks are invoked in that situation.)

      diff --git a/src/7.1/classes/ActiveSupport/FileUpdateChecker.html b/src/7.1/classes/ActiveSupport/FileUpdateChecker.html index 3f45a3d3f0..e6556e2b6d 100644 --- a/src/7.1/classes/ActiveSupport/FileUpdateChecker.html +++ b/src/7.1/classes/ActiveSupport/FileUpdateChecker.html @@ -39,10 +39,10 @@

      File U

    • execute which executes the given block on initialization and updates the latest watched files and timestamp.

    • -

      execute_if_updated which just executes the block if it was updated.

      +

      execute_if_updated which just executes the block if it was updated.

    -

    After initialization, a call to execute_if_updated must execute the block only if there was really a change in the filesystem.

    +

    After initialization, a call to execute_if_updated must execute the block only if there was really a change in the filesystem.

    This class is used by Rails to reload the I18n framework whenever they are changed upon a new request.

    @@ -247,7 +247,7 @@

    -

    Check if any of the entries were updated. If so, the watched and/or updated_at values are cached until the block is executed via execute or execute_if_updated.

    +

    Check if any of the entries were updated. If so, the watched and/or updated_at values are cached until the block is executed via execute or execute_if_updated.

    diff --git a/src/7.1/classes/ActiveSupport/HashWithIndifferentAccess.html b/src/7.1/classes/ActiveSupport/HashWithIndifferentAccess.html index 886e14e2cc..0af80128fc 100644 --- a/src/7.1/classes/ActiveSupport/HashWithIndifferentAccess.html +++ b/src/7.1/classes/ActiveSupport/HashWithIndifferentAccess.html @@ -63,7 +63,7 @@

    Hash#with_indifferent_access:

    rgb = { black: '#000000', white: '#FFFFFF' }.with_indifferent_access
     
    @@ -881,7 +881,7 @@

    -

    Returns true so that Array#extract_options! finds members of this class.

    +

    Returns true so that Array#extract_options! finds members of this class.

    @@ -1388,7 +1388,7 @@

    -

    Same semantics as reverse_merge but modifies the receiver in-place.

    +

    Same semantics as reverse_merge but modifies the receiver in-place.

    @@ -1895,7 +1895,7 @@

    hash.update({ "a" => 1 }, { "b" => 2 }) # => { "a" => 1, "b" => 2 }

    -

    The arguments can be either an ActiveSupport::HashWithIndifferentAccess or a regular Hash. In either case the merge respects the semantics of indifferent access.

    +

    The arguments can be either an ActiveSupport::HashWithIndifferentAccess or a regular Hash. In either case the merge respects the semantics of indifferent access.

    If the argument is a regular hash with keys :key and "key" only one of the values end up in the receiver, but which one is unspecified.

    diff --git a/src/7.1/classes/ActiveSupport/InheritableOptions.html b/src/7.1/classes/ActiveSupport/InheritableOptions.html index e01c2d17a5..8ab2ada4cd 100644 --- a/src/7.1/classes/ActiveSupport/InheritableOptions.html +++ b/src/7.1/classes/ActiveSupport/InheritableOptions.html @@ -31,7 +31,7 @@

    Inheritable Options

    -

    InheritableOptions provides a constructor to build an OrderedOptions hash inherited from another hash.

    +

    InheritableOptions provides a constructor to build an OrderedOptions hash inherited from another hash.

    Use this if you already have some hash and you want to create a new one based on it.

    diff --git a/src/7.1/classes/ActiveSupport/LazyLoadHooks.html b/src/7.1/classes/ActiveSupport/LazyLoadHooks.html index 043c6eec53..d0a9321960 100644 --- a/src/7.1/classes/ActiveSupport/LazyLoadHooks.html +++ b/src/7.1/classes/ActiveSupport/LazyLoadHooks.html @@ -25,7 +25,7 @@

    Lazy Load Hooks

    -

    LazyLoadHooks allows Rails to lazily load a lot of components and thus making the app boot faster. Because of this feature now there is no need to require ActiveRecord::Base at boot time purely to apply configuration. Instead a hook is registered that applies configuration once ActiveRecord::Base is loaded. Here ActiveRecord::Base is used as example but this feature can be applied elsewhere too.

    +

    LazyLoadHooks allows Rails to lazily load a lot of components and thus making the app boot faster. Because of this feature now there is no need to require ActiveRecord::Base at boot time purely to apply configuration. Instead a hook is registered that applies configuration once ActiveRecord::Base is loaded. Here ActiveRecord::Base is used as example but this feature can be applied elsewhere too.

    Here is an example where on_load method is called to register a hook.

    @@ -37,7 +37,7 @@

    Lazy Load Hoo end

    -

    When the entirety of ActiveRecord::Base has been evaluated then run_load_hooks is invoked. The very last line of ActiveRecord::Base is:

    +

    When the entirety of ActiveRecord::Base has been evaluated then run_load_hooks is invoked. The very last line of ActiveRecord::Base is:

    ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base)
     
    @@ -157,7 +157,7 @@

    ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base)
     
    -

    In the case of the above example, it will execute all hooks registered for :active_record within the class ActiveRecord::Base.

    +

    In the case of the above example, it will execute all hooks registered for :active_record within the class ActiveRecord::Base.

    diff --git a/src/7.1/classes/ActiveSupport/LogSubscriber.html b/src/7.1/classes/ActiveSupport/LogSubscriber.html index 53fed0fef4..4ec044179b 100644 --- a/src/7.1/classes/ActiveSupport/LogSubscriber.html +++ b/src/7.1/classes/ActiveSupport/LogSubscriber.html @@ -33,7 +33,7 @@

    Active Support Log Subscriber

    -

    ActiveSupport::LogSubscriber is an object set to consume ActiveSupport::Notifications with the sole purpose of logging them. The log subscriber dispatches notifications to a registered object based on its given namespace.

    +

    ActiveSupport::LogSubscriber is an object set to consume ActiveSupport::Notifications with the sole purpose of logging them. The log subscriber dispatches notifications to a registered object based on its given namespace.

    An example would be Active Record log subscriber responsible for logging queries:

    @@ -52,7 +52,7 @@

    After configured, whenever a "sql.active_record" notification is published, it will properly dispatch the event (ActiveSupport::Notifications::Event) to the sql method.

    -

    Being an ActiveSupport::Notifications consumer, ActiveSupport::LogSubscriber exposes a simple interface to check if instrumented code raises an exception. It is common to log a different message in case of an error, and this can be achieved by extending the previous example:

    +

    Being an ActiveSupport::Notifications consumer, ActiveSupport::LogSubscriber exposes a simple interface to check if instrumented code raises an exception. It is common to log a different message in case of an error, and this can be achieved by extending the previous example:

    module ActiveRecord
       class LogSubscriber < ActiveSupport::LogSubscriber
    @@ -72,7 +72,7 @@ 

    end

    -

    ActiveSupport::LogSubscriber also has some helpers to deal with logging. For example, ActiveSupport::LogSubscriber.flush_all! will ensure that all logs are flushed, and it is called in Rails::Rack::Logger after a request finishes.

    +

    ActiveSupport::LogSubscriber also has some helpers to deal with logging. For example, ActiveSupport::LogSubscriber.flush_all! will ensure that all logs are flushed, and it is called in Rails::Rack::Logger after a request finishes.

    diff --git a/src/7.1/classes/ActiveSupport/MessageEncryptor.html b/src/7.1/classes/ActiveSupport/MessageEncryptor.html index ac202d09cb..bfe1ca4f2b 100644 --- a/src/7.1/classes/ActiveSupport/MessageEncryptor.html +++ b/src/7.1/classes/ActiveSupport/MessageEncryptor.html @@ -45,7 +45,7 @@

    decrypt_and_verify method will raise an ActiveSupport::MessageEncryptor::InvalidMessage exception if the data provided cannot be decrypted or verified.

    crypt.decrypt_and_verify('not encrypted data') # => ActiveSupport::MessageEncryptor::InvalidMessage
     
    @@ -83,7 +83,7 @@

    Maki

    Rotating keys

    -

    MessageEncryptor also supports rotating out old configurations by falling back to a stack of encryptors. Call rotate to build and add an encryptor so decrypt_and_verify will also try the fallback.

    +

    MessageEncryptor also supports rotating out old configurations by falling back to a stack of encryptors. Call rotate to build and add an encryptor so decrypt_and_verify will also try the fallback.

    By default any rotated encryptors use the values of the primary encryptor unless specified otherwise.

    @@ -230,13 +230,13 @@

    Options

    -
    :cipher +
    :cipher

    Cipher to use. Can be any cipher returned by OpenSSL::Cipher.ciphers. Default is ‘aes-256-gcm’.

    -
    :digest +
    :digest

    Digest used for signing. Ignored when using an AEAD cipher like ‘aes-256-gcm’.

    -
    :serializer +
    :serializer

    The serializer used to serialize message data. You can specify any object that responds to dump and load, or you can choose from several preconfigured serializers: :marshal, :json_allow_marshal, :json, :message_pack_allow_marshal, :message_pack.

    @@ -247,10 +247,10 @@

    Options

    The :message_pack and :message_pack_allow_marshal serializers use ActiveSupport::MessagePack, which can roundtrip some Ruby types that are not supported by JSON, and may provide improved performance. However, these require the msgpack gem.

    When using Rails, the default depends on config.active_support.message_serializer. Otherwise, the default is :marshal.

    -
    :url_safe +
    :url_safe

    By default, MessageEncryptor generates RFC 4648 compliant strings which are not URL-safe. In other words, they can contain “+” and “/”. If you want to generate URL-safe strings (in compliance with “Base 64 Encoding with URL and Filename Safe Alphabet” in RFC 4648), you can pass true.

    -
    :force_legacy_metadata_serializer +
    :force_legacy_metadata_serializer

    Whether to use the legacy metadata serializer, which serializes the message first, then wraps it in an envelope which is also serialized. This was the default in Rails 7.0 and below.

    @@ -303,9 +303,9 @@

    Decrypt and verify a message. We need to verify the message in order to avoid padding attacks. Reference: www.limited-entropy.com/padding-oracle-attacks/.

    Options

    -
    :purpose +
    :purpose
    -

    The purpose that the message was generated with. If the purpose does not match, decrypt_and_verify will return nil.

    +

    The purpose that the message was generated with. If the purpose does not match, decrypt_and_verify will return nil.

    message = encryptor.encrypt_and_sign("hello", purpose: "greeting")
     encryptor.decrypt_and_verify(message, purpose: "greeting") # => "hello"
    @@ -359,7 +359,7 @@ 

    Encrypt and sign a message. We need to sign the message in order to avoid padding attacks. Reference: www.limited-entropy.com/padding-oracle-attacks/.

    Options

    -
    :expires_at +
    :expires_at

    The datetime at which the message expires. After this datetime, verification of the message will fail.

    @@ -368,7 +368,7 @@

    Options

    # 24 hours later... encryptor.decrypt_and_verify(message) # => nil
    -
    :expires_in +
    :expires_in

    The duration for which the message is valid. After this duration has elapsed, verification of the message will fail.

    @@ -377,7 +377,7 @@

    Options

    # 24 hours later... encryptor.decrypt_and_verify(message) # => nil -
    :purpose +
    :purpose

    The purpose of the message. If specified, the same purpose must be specified when verifying the message; otherwise, verification will fail. (See decrypt_and_verify.)

    diff --git a/src/7.1/classes/ActiveSupport/MessagePack.html b/src/7.1/classes/ActiveSupport/MessagePack.html index a42f9e2e45..aeb9458327 100644 --- a/src/7.1/classes/ActiveSupport/MessagePack.html +++ b/src/7.1/classes/ActiveSupport/MessagePack.html @@ -148,7 +148,7 @@

    -

    Returns true if the given dump begins with an ActiveSupport::MessagePack signature.

    +

    Returns true if the given dump begins with an ActiveSupport::MessagePack signature.

    diff --git a/src/7.1/classes/ActiveSupport/MessageVerifier.html b/src/7.1/classes/ActiveSupport/MessageVerifier.html index 0b28732237..cdee9ebda1 100644 --- a/src/7.1/classes/ActiveSupport/MessageVerifier.html +++ b/src/7.1/classes/ActiveSupport/MessageVerifier.html @@ -31,9 +31,9 @@

    Active Support Message Verifier

    -

    MessageVerifier makes it easy to generate and verify messages which are signed to prevent tampering.

    +

    MessageVerifier makes it easy to generate and verify messages which are signed to prevent tampering.

    -

    In a Rails application, you can use Rails.application.message_verifier to manage unique instances of verifiers for each use case. Learn more.

    +

    In a Rails application, you can use Rails.application.message_verifier to manage unique instances of verifiers for each use case. Learn more.

    This is useful for cases like remember-me tokens and auto-unsubscribe links where the session store isn’t suitable or available.

    @@ -86,7 +86,7 @@

    Expiring m @verifier.generate("signed message", expires_at: Time.now.end_of_year) -

    Messages can then be verified and returned until expiry. Thereafter, the verified method returns nil while verify raises ActiveSupport::MessageVerifier::InvalidSignature.

    +

    Messages can then be verified and returned until expiry. Thereafter, the verified method returns nil while verify raises ActiveSupport::MessageVerifier::InvalidSignature.

    Rotating keys

    @@ -189,10 +189,10 @@

    Initialize a new MessageVerifier with a secret for the signature.

    Options

    -
    :digest +
    :digest

    Digest used for signing. The default is "SHA1". See OpenSSL::Digest for alternatives.

    -
    :serializer +
    :serializer

    The serializer used to serialize message data. You can specify any object that responds to dump and load, or you can choose from several preconfigured serializers: :marshal, :json_allow_marshal, :json, :message_pack_allow_marshal, :message_pack.

    @@ -203,10 +203,10 @@

    Options

    The :message_pack and :message_pack_allow_marshal serializers use ActiveSupport::MessagePack, which can roundtrip some Ruby types that are not supported by JSON, and may provide improved performance. However, these require the msgpack gem.

    When using Rails, the default depends on config.active_support.message_serializer. Otherwise, the default is :marshal.

    -
    :url_safe +
    :url_safe

    By default, MessageVerifier generates RFC 4648 compliant strings which are not URL-safe. In other words, they can contain “+” and “/”. If you want to generate URL-safe strings (in compliance with “Base 64 Encoding with URL and Filename Safe Alphabet” in RFC 4648), you can pass true.

    -
    :force_legacy_metadata_serializer +
    :force_legacy_metadata_serializer

    Whether to use the legacy metadata serializer, which serializes the message first, then wraps it in an envelope which is also serialized. This was the default in Rails 7.0 and below.

    @@ -255,14 +255,14 @@

    Generates a signed message for the provided value.

    -

    The message is signed with the MessageVerifier‘s secret. Returns Base64-encoded message joined with the generated signature.

    +

    The message is signed with the MessageVerifier‘s secret. Returns Base64-encoded message joined with the generated signature.

    verifier = ActiveSupport::MessageVerifier.new("secret")
     verifier.generate("signed message") # => "BAhJIhNzaWduZWQgbWVzc2FnZQY6BkVU--f67d5f27c3ee0b8483cebf2103757455e947493b"
     

    Options

    -
    :expires_at +
    :expires_at

    The datetime at which the message expires. After this datetime, verification of the message will fail.

    @@ -272,7 +272,7 @@

    Options

    verifier.verified(message) # => nil verifier.verify(message) # => raises ActiveSupport::MessageVerifier::InvalidSignature -
    :expires_in +

    :expires_in

    The duration for which the message is valid. After this duration has elapsed, verification of the message will fail.

    @@ -282,7 +282,7 @@

    Options

    verifier.verified(message) # => nil verifier.verify(message) # => raises ActiveSupport::MessageVerifier::InvalidSignature -
    :purpose +
    :purpose

    The purpose of the message. If specified, the same purpose must be specified when verifying the message; otherwise, verification will fail. (See verified and verify.)

    @@ -320,7 +320,7 @@

    -

    Checks if a signed message could have been generated by signing an object with the MessageVerifier‘s secret.

    +

    Checks if a signed message could have been generated by signing an object with the MessageVerifier‘s secret.

    verifier = ActiveSupport::MessageVerifier.new("secret")
     signed_message = verifier.generate("signed message")
    @@ -363,7 +363,7 @@ 

    -

    Decodes the signed message using the MessageVerifier‘s secret.

    +

    Decodes the signed message using the MessageVerifier‘s secret.

    verifier = ActiveSupport::MessageVerifier.new("secret")
     
    @@ -390,7 +390,7 @@ 

    Options

    -
    :purpose +
    :purpose

    The purpose that the message was generated with. If the purpose does not match, verified will return nil.

    @@ -444,7 +444,7 @@

    -

    Decodes the signed message using the MessageVerifier‘s secret.

    +

    Decodes the signed message using the MessageVerifier‘s secret.

    verifier = ActiveSupport::MessageVerifier.new("secret")
     signed_message = verifier.generate("signed message")
    @@ -452,14 +452,14 @@ 

    verifier.verify(signed_message) # => "signed message"

    -

    Raises InvalidSignature if the message was not signed with the same secret or was not Base64-encoded.

    +

    Raises InvalidSignature if the message was not signed with the same secret or was not Base64-encoded.

    other_verifier = ActiveSupport::MessageVerifier.new("different_secret")
     other_verifier.verify(signed_message) # => ActiveSupport::MessageVerifier::InvalidSignature
     

    Options

    -
    :purpose +
    :purpose

    The purpose that the message was generated with. If the purpose does not match, verify will raise ActiveSupport::MessageVerifier::InvalidSignature.

    diff --git a/src/7.1/classes/ActiveSupport/Multibyte/Chars.html b/src/7.1/classes/ActiveSupport/Multibyte/Chars.html index 9b717f9ac4..283c887070 100644 --- a/src/7.1/classes/ActiveSupport/Multibyte/Chars.html +++ b/src/7.1/classes/ActiveSupport/Multibyte/Chars.html @@ -39,7 +39,7 @@

    Chars objects are perfectly interchangeable with String objects as long as no explicit class checks are made. If certain methods do explicitly check the class, call to_s before you pass chars objects to them.

    +

    Chars objects are perfectly interchangeable with String objects as long as no explicit class checks are made. If certain methods do explicitly check the class, call to_s before you pass chars objects to them.

    bad.explicit_checking_method 'T'.mb_chars.downcase.to_s
     
    diff --git a/src/7.1/classes/ActiveSupport/Notifications.html b/src/7.1/classes/ActiveSupport/Notifications.html index 0213b36fc2..7ed2168a59 100644 --- a/src/7.1/classes/ActiveSupport/Notifications.html +++ b/src/7.1/classes/ActiveSupport/Notifications.html @@ -29,7 +29,7 @@

    Notifications

    -

    ActiveSupport::Notifications provides an instrumentation API for Ruby.

    +

    ActiveSupport::Notifications provides an instrumentation API for Ruby.

    Instrumenters

    @@ -372,7 +372,7 @@

    -

    Performs the same functionality as subscribe, but the start and finish block arguments are in monotonic time instead of wall-clock time. Monotonic time will not jump forward or backward (due to NTP or Daylights Savings). Use monotonic_subscribe when accuracy of time duration is important. For example, computing elapsed time between two events.

    +

    Performs the same functionality as subscribe, but the start and finish block arguments are in monotonic time instead of wall-clock time. Monotonic time will not jump forward or backward (due to NTP or Daylights Savings). Use monotonic_subscribe when accuracy of time duration is important. For example, computing elapsed time between two events.

    diff --git a/src/7.1/classes/ActiveSupport/Notifications/Fanout/Handle.html b/src/7.1/classes/ActiveSupport/Notifications/Fanout/Handle.html index 21ce583da9..c14bf1c026 100644 --- a/src/7.1/classes/ActiveSupport/Notifications/Fanout/Handle.html +++ b/src/7.1/classes/ActiveSupport/Notifications/Fanout/Handle.html @@ -29,11 +29,11 @@

    -

    A Handle is used to record the start and finish time of event.

    +

    A Handle is used to record the start and finish time of event.

    Both start and finish must each be called exactly once.

    -

    Where possible, it’s best to use the block form: ActiveSupport::Notifications.instrument. Handle is a low-level API intended for cases where the block form can’t be used.

    +

    Where possible, it’s best to use the block form: ActiveSupport::Notifications.instrument. Handle is a low-level API intended for cases where the block form can’t be used.

    handle = ActiveSupport::Notifications.instrumenter.build_handle("my.event", {})
     begin
    diff --git a/src/7.1/classes/ActiveSupport/Notifications/Instrumenter.html b/src/7.1/classes/ActiveSupport/Notifications/Instrumenter.html
    index 1ec755e57e..2486d5ea03 100644
    --- a/src/7.1/classes/ActiveSupport/Notifications/Instrumenter.html
    +++ b/src/7.1/classes/ActiveSupport/Notifications/Instrumenter.html
    @@ -159,7 +159,7 @@ 

    start and finish must each be called exactly once on the returned object.

    -

    Where possible, it’s best to use instrument, which will record the start and finish of the event and correctly handle any exceptions. build_handle is a low-level API intended for cases where using instrument isn’t possible.

    +

    Where possible, it’s best to use instrument, which will record the start and finish of the event and correctly handle any exceptions. build_handle is a low-level API intended for cases where using instrument isn’t possible.

    See ActiveSupport::Notifications::Fanout::Handle.

    diff --git a/src/7.1/classes/ActiveSupport/NumberHelper.html b/src/7.1/classes/ActiveSupport/NumberHelper.html index b871b16f35..be07a8910a 100644 --- a/src/7.1/classes/ActiveSupport/NumberHelper.html +++ b/src/7.1/classes/ActiveSupport/NumberHelper.html @@ -121,51 +121,51 @@

    The currency unit and number formatting of the current locale will be used unless otherwise specified via options. No currency conversion is performed. If the user is given a way to change their locale, they will also be able to change the relative value of the currency displayed with this helper. If your application will ever support multiple locales, you may want to specify a constant :locale option or consider using a library capable of currency conversion.

    Options

    -
    :locale +
    :locale

    The locale to use for formatting. Defaults to the current locale.

    number_to_currency(1234567890.506, locale: :fr)
     # => "1 234 567 890,51 €"
     
    -
    :precision +

    :precision

    The level of precision. Defaults to 2.

    number_to_currency(1234567890.123, precision: 3) # => "$1,234,567,890.123"
     number_to_currency(0.456789, precision: 0)       # => "$0"
     
    -
    :round_mode +

    :round_mode

    Specifies how rounding is performed. See BigDecimal.mode. Defaults to :default.

    number_to_currency(1234567890.01, precision: 0, round_mode: :up)
     # => "$1,234,567,891"
     
    -
    :unit +
    :unit

    The denomination of the currency. Defaults to "$".

    -
    :separator +
    :separator

    The decimal separator. Defaults to ".".

    -
    :delimiter +
    :delimiter

    The thousands delimiter. Defaults to ",".

    -
    :format +
    :format

    The format for non-negative numbers. %u represents the currency, and %n represents the number. Defaults to "%u%n".

    number_to_currency(1234567890.50, format: "%n %u")
     # => "1,234,567,890.50 $"
     
    -
    :negative_format +
    :negative_format

    The format for negative numbers. %u and %n behave the same as in :format, but %n represents the absolute value of the number. Defaults to the value of :format prepended with -.

    number_to_currency(-1234567890.50, negative_format: "(%u%n)")
     # => "($1,234,567,890.50)"
     
    -
    :strip_insignificant_zeros +
    :strip_insignificant_zeros

    Whether to remove insignificant zeros after the decimal separator. Defaults to false.

    @@ -219,28 +219,28 @@

    Options

    -
    :locale +
    :locale

    The locale to use for formatting. Defaults to the current locale.

    number_to_delimited(12345678.05, locale: :fr)
     # => "12 345 678,05"
     
    -
    :delimiter +
    :delimiter

    The thousands delimiter. Defaults to ",".

    number_to_delimited(12345678, delimiter: ".")
     # => "12.345.678"
     
    -
    :separator +
    :separator

    The decimal separator. Defaults to ".".

    number_to_delimited(12345678.05, separator: " ")
     # => "12,345,678 05"
     
    -
    :delimiter_pattern +
    :delimiter_pattern

    A regexp to determine the placement of delimiters. Helpful when using currency formats like INR.

    @@ -297,37 +297,37 @@

    See number_to_human_size if you want to pretty-print a file size.

    Options

    -
    :locale +
    :locale

    The locale to use for formatting. Defaults to the current locale.

    -
    :precision +
    :precision

    The level of precision. Defaults to 3.

    number_to_human(123456, precision: 2) # => "120 Thousand"
     number_to_human(123456, precision: 4) # => "123.5 Thousand"
     
    -
    :round_mode +
    :round_mode

    Specifies how rounding is performed. See BigDecimal.mode. Defaults to :default.

    number_to_human(123456, precision: 2, round_mode: :up)
     # => "130 Thousand"
     
    -
    :significant +
    :significant

    Whether :precision should be applied to significant digits instead of fractional digits. Defaults to true.

    -
    :separator +
    :separator

    The decimal separator. Defaults to ".".

    number_to_human(123456, precision: 4, separator: ",")
     # => "123,5 Thousand"
     
    -
    :delimiter +
    :delimiter

    The thousands delimiter. Defaults to ",".

    -
    :strip_insignificant_zeros +
    :strip_insignificant_zeros

    Whether to remove insignificant zeros after the decimal separator. Defaults to true.

    @@ -336,10 +336,10 @@

    Options

    number_to_human(10.01) # => "10" number_to_human(10.01, strip_insignificant_zeros: false) # => "10.0"
    -
    :format +
    :format

    The format of the output. %n represents the number, and %u represents the quantifier (e.g., “Thousand”). Defaults to "%n %u".

    -
    :units +
    :units

    A Hash of custom unit quantifier names.

    @@ -427,37 +427,37 @@

    See number_to_human if you want to pretty-print a generic number.

    Options

    -
    :locale +
    :locale

    The locale to use for formatting. Defaults to the current locale.

    -
    :precision +
    :precision

    The level of precision. Defaults to 3.

    number_to_human_size(123456, precision: 2)  # => "120 KB"
     number_to_human_size(1234567, precision: 2) # => "1.2 MB"
     
    -
    :round_mode +
    :round_mode

    Specifies how rounding is performed. See BigDecimal.mode. Defaults to :default.

    number_to_human_size(123456, precision: 2, round_mode: :up)
     # => "130 KB"
     
    -
    :significant +
    :significant

    Whether :precision should be applied to significant digits instead of fractional digits. Defaults to true.

    -
    :separator +
    :separator

    The decimal separator. Defaults to ".".

    number_to_human_size(1234567, separator: ",")
     # => "1,18 MB"
     
    -
    :delimiter +
    :delimiter

    The thousands delimiter. Defaults to ",".

    -
    :strip_insignificant_zeros +
    :strip_insignificant_zeros

    Whether to remove insignificant zeros after the decimal separator. Defaults to true.

    @@ -506,14 +506,14 @@

    Options

    -
    :locale +
    :locale

    The locale to use for formatting. Defaults to the current locale.

    number_to_percentage(1000, locale: :fr)
     # => "1000,000%"
     
    -
    :precision +
    :precision

    The level of precision, or nil to preserve number‘s precision. Defaults to 2.

    @@ -521,14 +521,14 @@

    Options

    number_to_percentage(99.999, precision: 0) # => "100%" number_to_percentage(99.999, precision: nil) # => "99.999%" -
    :round_mode +
    :round_mode

    Specifies how rounding is performed. See BigDecimal.mode. Defaults to :default.

    number_to_percentage(12.3456789, precision: 4, round_mode: :down)
     # => "12.3456%"
     
    -
    :significant +
    :significant

    Whether :precision should be applied to significant digits instead of fractional digits. Defaults to false.

    @@ -537,16 +537,16 @@

    Options

    number_to_percentage(12345.6789, precision: 2) # => "12345.68%" number_to_percentage(12345.6789, precision: 2, significant: true) # => "12000%" -
    :separator +
    :separator

    The decimal separator. Defaults to ".".

    -
    :delimiter +
    :delimiter

    The thousands delimiter. Defaults to ",".

    -
    :strip_insignificant_zeros +
    :strip_insignificant_zeros

    Whether to remove insignificant zeros after the decimal separator. Defaults to false.

    -
    :format +
    :format

    The format of the output. %n represents the number. Defaults to "%n%".

    @@ -600,35 +600,35 @@

    Options

    -
    :area_code +
    :area_code

    Whether to use parentheses for the area code. Defaults to false.

    number_to_phone(1235551234, area_code: true)
     # => "(123) 555-1234"
     
    -
    :delimiter +
    :delimiter

    The digit group delimiter to use. Defaults to "-".

    number_to_phone(1235551234, delimiter: " ")
     # => "123 555 1234"
     
    -
    :country_code +
    :country_code

    A country code to prepend.

    number_to_phone(1235551234, country_code: 1)
     # => "+1-123-555-1234"
     
    -
    :extension +
    :extension

    An extension to append.

    number_to_phone(1235551234, extension: 555)
     # => "123-555-1234 x 555"
     
    -
    :pattern +
    :pattern

    A regexp that specifies how the digits should be grouped. The first three captures from the regexp are treated as digit groups.

    @@ -681,28 +681,28 @@

    Options

    -
    :locale +
    :locale

    The locale to use for formatting. Defaults to the current locale.

    number_to_rounded(111.234, locale: :fr)
     # => "111,234"
     
    -
    :precision +
    :precision

    The level of precision, or nil to preserve number‘s precision. Defaults to 3.

    number_to_rounded(12345.6789, precision: nil)
     # => "12345.6789"
     
    -
    :round_mode +
    :round_mode

    Specifies how rounding is performed. See BigDecimal.mode. Defaults to :default.

    number_to_rounded(12.34, precision: 0, round_mode: :up)
     # => "13"
     
    -
    :significant +
    :significant

    Whether :precision should be applied to significant digits instead of fractional digits. Defaults to false.

    @@ -711,13 +711,13 @@

    Options

    number_to_rounded(12345.6789, precision: 2) # => "12345.68" number_to_rounded(12345.6789, precision: 2, significant: true) # => "12000" -
    :separator +
    :separator

    The decimal separator. Defaults to ".".

    -
    :delimiter +
    :delimiter

    The thousands delimiter. Defaults to ",".

    -
    :strip_insignificant_zeros +
    :strip_insignificant_zeros

    Whether to remove insignificant zeros after the decimal separator. Defaults to false.

    diff --git a/src/7.1/classes/ActiveSupport/NumericWithFormat.html b/src/7.1/classes/ActiveSupport/NumericWithFormat.html index 70f246717b..7301ff525d 100644 --- a/src/7.1/classes/ActiveSupport/NumericWithFormat.html +++ b/src/7.1/classes/ActiveSupport/NumericWithFormat.html @@ -99,7 +99,7 @@

    Provides options for converting numbers into formatted strings. Options are provided for phone numbers, currency, percentage, precision, positional notation, file size, and pretty printing.

    -

    This method is aliased to to_formatted_s.

    +

    This method is aliased to to_formatted_s.

    Options

    diff --git a/src/7.1/classes/ActiveSupport/OrderedOptions.html b/src/7.1/classes/ActiveSupport/OrderedOptions.html index 2dca8885b9..c3068aa982 100644 --- a/src/7.1/classes/ActiveSupport/OrderedOptions.html +++ b/src/7.1/classes/ActiveSupport/OrderedOptions.html @@ -31,9 +31,9 @@

    Ordered Options

    -

    OrderedOptions inherits from Hash and provides dynamic accessor methods.

    +

    OrderedOptions inherits from Hash and provides dynamic accessor methods.

    -

    With a Hash, key-value pairs are typically managed like this:

    +

    With a Hash, key-value pairs are typically managed like this:

    h = {}
     h[:boy] = 'John'
    @@ -43,7 +43,7 @@ 

    Ordered Optio h[:dog] # => nil

    -

    Using OrderedOptions, the above code can be written as:

    +

    Using OrderedOptions, the above code can be written as:

    h = ActiveSupport::OrderedOptions.new
     h.boy = 'John'
    diff --git a/src/7.1/classes/ActiveSupport/ParameterFilter.html b/src/7.1/classes/ActiveSupport/ParameterFilter.html
    index 0134e46c3c..6b7c5d837b 100644
    --- a/src/7.1/classes/ActiveSupport/ParameterFilter.html
    +++ b/src/7.1/classes/ActiveSupport/ParameterFilter.html
    @@ -31,11 +31,11 @@ 

    Active Support Parameter Filter

    -

    ParameterFilter replaces values in a Hash-like object if their keys match one of the specified filters.

    +

    ParameterFilter replaces values in a Hash-like object if their keys match one of the specified filters.

    Matching based on nested keys is possible by using dot notation, e.g. "credit_card.number".

    -

    If a proc is given as a filter, each key and value of the Hash-like and of any nested Hashes will be passed to it. The value or key can then be mutated as desired using methods such as String#replace.

    +

    If a proc is given as a filter, each key and value of the Hash-like and of any nested Hashes will be passed to it. The value or key can then be mutated as desired using methods such as String#replace.

    # Replaces values with "[FILTERED]" for keys that match /password/i.
     ActiveSupport::ParameterFilter.new([:password])
    @@ -116,7 +116,7 @@ 

    -

    Create instance with given filters. Supported type of filters are String, Regexp, and Proc. Other types of filters are treated as String using to_s. For Proc filters, key, value, and optional original hash is passed to block arguments.

    +

    Create instance with given filters. Supported type of filters are String, Regexp, and Proc. Other types of filters are treated as String using to_s. For Proc filters, key, value, and optional original hash is passed to block arguments.

    Options

    • diff --git a/src/7.1/classes/ActiveSupport/RangeWithFormat.html b/src/7.1/classes/ActiveSupport/RangeWithFormat.html index 23ad78f63e..182b82dec2 100644 --- a/src/7.1/classes/ActiveSupport/RangeWithFormat.html +++ b/src/7.1/classes/ActiveSupport/RangeWithFormat.html @@ -138,7 +138,7 @@

      Convert range to a formatted string. See RANGE_FORMATS for predefined formats.

      -

      This method is aliased to to_formatted_s.

      +

      This method is aliased to to_formatted_s.

      range = (1..100)           # => 1..100
       
      diff --git a/src/7.1/classes/ActiveSupport/Rescuable/ClassMethods.html b/src/7.1/classes/ActiveSupport/Rescuable/ClassMethods.html
      index cbf40318be..5c6f271de0 100644
      --- a/src/7.1/classes/ActiveSupport/Rescuable/ClassMethods.html
      +++ b/src/7.1/classes/ActiveSupport/Rescuable/ClassMethods.html
      @@ -70,9 +70,9 @@ 

      -

      Registers exception classes with a handler to be called by rescue_with_handler.

      +

      Registers exception classes with a handler to be called by rescue_with_handler.

      -

      rescue_from receives a series of exception classes or class names, and an exception handler specified by a trailing :with option containing the name of a method or a Proc object. Alternatively, a block can be given as the handler.

      +

      rescue_from receives a series of exception classes or class names, and an exception handler specified by a trailing :with option containing the name of a method or a Proc object. Alternatively, a block can be given as the handler.

      Handlers that take one argument will be called with the exception, so that the exception can be inspected when dealing with it.

      diff --git a/src/7.1/classes/ActiveSupport/StringInquirer.html b/src/7.1/classes/ActiveSupport/StringInquirer.html index a47527dfbf..874ee2ae7e 100644 --- a/src/7.1/classes/ActiveSupport/StringInquirer.html +++ b/src/7.1/classes/ActiveSupport/StringInquirer.html @@ -31,7 +31,7 @@

      String Inquirer

      -

      Wrapping a string in this class gives you a prettier way to test for equality. The value returned by Rails.env is wrapped in a StringInquirer object, so instead of calling this:

      +

      Wrapping a string in this class gives you a prettier way to test for equality. The value returned by Rails.env is wrapped in a StringInquirer object, so instead of calling this:

      Rails.env == 'production'
       
      diff --git a/src/7.1/classes/ActiveSupport/Subscriber.html b/src/7.1/classes/ActiveSupport/Subscriber.html index 826783cd87..6711810e79 100644 --- a/src/7.1/classes/ActiveSupport/Subscriber.html +++ b/src/7.1/classes/ActiveSupport/Subscriber.html @@ -31,7 +31,7 @@

      Active Support Subscriber

      -

      ActiveSupport::Subscriber is an object set to consume ActiveSupport::Notifications. The subscriber dispatches notifications to a registered object based on its given namespace.

      +

      ActiveSupport::Subscriber is an object set to consume ActiveSupport::Notifications. The subscriber dispatches notifications to a registered object based on its given namespace.

      An example would be an Active Record subscriber responsible for collecting statistics about queries:

      diff --git a/src/7.1/classes/ActiveSupport/Testing/Deprecation.html b/src/7.1/classes/ActiveSupport/Testing/Deprecation.html index 0567e9bafa..73da89c9a1 100644 --- a/src/7.1/classes/ActiveSupport/Testing/Deprecation.html +++ b/src/7.1/classes/ActiveSupport/Testing/Deprecation.html @@ -82,7 +82,7 @@

      end

      -

      The match object may be a Regexp, or String appearing in the message.

      +

      The match object may be a Regexp, or String appearing in the message.

      assert_deprecated('foo', CustomDeprecator) do
         CustomDeprecator.warn "foo should no longer be used"
      diff --git a/src/7.1/classes/ActiveSupport/Testing/ErrorReporterAssertions.html b/src/7.1/classes/ActiveSupport/Testing/ErrorReporterAssertions.html
      index 6e7ebd29e9..b0475822f8 100644
      --- a/src/7.1/classes/ActiveSupport/Testing/ErrorReporterAssertions.html
      +++ b/src/7.1/classes/ActiveSupport/Testing/ErrorReporterAssertions.html
      @@ -83,7 +83,7 @@ 

      -

      Assertion that the block should cause at least one exception to be reported to Rails.error.

      +

      Assertion that the block should cause at least one exception to be reported to Rails.error.

      Passes if the evaluated code in the yielded block reports a matching exception.

      @@ -150,7 +150,7 @@

      -

      Assertion that the block should not cause an exception to be reported to Rails.error.

      +

      Assertion that the block should not cause an exception to be reported to Rails.error.

      Passes if evaluated code in the yielded block reports no exception.

      diff --git a/src/7.1/classes/ActiveSupport/Testing/FileFixtures.html b/src/7.1/classes/ActiveSupport/Testing/FileFixtures.html index ea20c0698c..e125798d82 100644 --- a/src/7.1/classes/ActiveSupport/Testing/FileFixtures.html +++ b/src/7.1/classes/ActiveSupport/Testing/FileFixtures.html @@ -25,7 +25,7 @@

      Adds simple access to sample files called file fixtures. File fixtures are normal files stored in ActiveSupport::TestCase.file_fixture_path.

      -

      File fixtures are represented as Pathname objects. This makes it easy to extract specific information:

      +

      File fixtures are represented as Pathname objects. This makes it easy to extract specific information:

      file_fixture("example.txt").read # get the file's content
       file_fixture("example.mp3").size # get the file size
      @@ -78,7 +78,7 @@ 

      -

      Returns a Pathname to the fixture file named fixture_name.

      +

      Returns a Pathname to the fixture file named fixture_name.

      Raises ArgumentError if fixture_name can’t be found.

      diff --git a/src/7.1/classes/ActiveSupport/Testing/SetupAndTeardown.html b/src/7.1/classes/ActiveSupport/Testing/SetupAndTeardown.html index a522ea453c..cd4c1a88fd 100644 --- a/src/7.1/classes/ActiveSupport/Testing/SetupAndTeardown.html +++ b/src/7.1/classes/ActiveSupport/Testing/SetupAndTeardown.html @@ -23,7 +23,7 @@

      -

      Adds support for setup and teardown callbacks. These callbacks serve as a replacement to overwriting the #setup and #teardown methods of your TestCase.

      +

      Adds support for setup and teardown callbacks. These callbacks serve as a replacement to overwriting the setup and teardown methods of your TestCase.

      class ExampleTest < ActiveSupport::TestCase
         setup do
      diff --git a/src/7.1/classes/ActiveSupport/Testing/TimeHelpers.html b/src/7.1/classes/ActiveSupport/Testing/TimeHelpers.html
      index 329640b869..a685dfcd8d 100644
      --- a/src/7.1/classes/ActiveSupport/Testing/TimeHelpers.html
      +++ b/src/7.1/classes/ActiveSupport/Testing/TimeHelpers.html
      @@ -128,7 +128,7 @@ 

      -

      Calls travel_to with Time.now. Forwards optional with_usec argument.

      +

      Calls travel_to with Time.now. Forwards optional with_usec argument.

      Time.current # => Sun, 09 Jul 2017 15:34:49 EST -05:00
       freeze_time
      @@ -232,7 +232,7 @@ 

      -

      Returns the current time back to its original state, by removing the stubs added by travel, travel_to, and freeze_time.

      +

      Returns the current time back to its original state, by removing the stubs added by travel, travel_to, and freeze_time.

      Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00
       
      @@ -308,7 +308,7 @@ 

      DateTime.current # => Wed, 24 Nov 2004 01:04:44 -0500

      -

      Dates are taken as their timestamp at the beginning of the day in the application time zone. Time.current returns said timestamp, and Time.now its equivalent in the system time zone. Similarly, Date.current returns a date equal to the argument, and Date.today the date according to Time.now, which may be different. (Note that you rarely want to deal with Time.now, or Date.today, in order to honor the application time zone please always use Time.current and Date.current.)

      +

      Dates are taken as their timestamp at the beginning of the day in the application time zone. Time.current returns said timestamp, and Time.now its equivalent in the system time zone. Similarly, Date.current returns a date equal to the argument, and Date.today the date according to Time.now, which may be different. (Note that you rarely want to deal with Time.now, or Date.today, in order to honor the application time zone please always use Time.current and Date.current.)

      Note that the usec for the time passed will be set to 0 to prevent rounding errors with external services, like MySQL (which will round instead of floor, leading to off-by-one-second errors), unless the with_usec argument is set to true.

      diff --git a/src/7.1/classes/ActiveSupport/TimeWithZone.html b/src/7.1/classes/ActiveSupport/TimeWithZone.html index ecc90dbee0..ff6e26deae 100644 --- a/src/7.1/classes/ActiveSupport/TimeWithZone.html +++ b/src/7.1/classes/ActiveSupport/TimeWithZone.html @@ -33,7 +33,7 @@

      A

      A Time-like class that can represent a time in any time zone. Necessary because standard Ruby Time instances are limited to UTC and the system’s ENV['TZ'] zone.

      -

      You shouldn’t ever need to create a TimeWithZone instance directly via new. Instead use methods local, parse, at, and now on TimeZone instances, and in_time_zone on Time and DateTime instances.

      +

      You shouldn’t ever need to create a TimeWithZone instance directly via new. Instead use methods local, parse, at, and now on TimeZone instances, and in_time_zone on Time and DateTime instances.

      Time.zone = 'Eastern Time (US & Canada)'        # => 'Eastern Time (US & Canada)'
       Time.zone.local(2007, 2, 10, 15, 30, 45)        # => Sat, 10 Feb 2007 15:30:45.000000000 EST -05:00
      @@ -854,7 +854,7 @@ 

      -

      Returns a new ActiveSupport::TimeWithZone where one or more of the elements have been changed according to the options parameter. The time options (:hour, :min, :sec, :usec, :nsec) reset cascadingly, so if only the hour is passed, then minute, sec, usec, and nsec is set to 0. If the hour and minute is passed, then sec, usec, and nsec is set to 0. The options parameter takes a hash with any of these keys: :year, :month, :day, :hour, :min, :sec, :usec, :nsec, :offset, :zone. Pass either :usec or :nsec, not both. Similarly, pass either :zone or :offset, not both.

      +

      Returns a new ActiveSupport::TimeWithZone where one or more of the elements have been changed according to the options parameter. The time options (:hour, :min, :sec, :usec, :nsec) reset cascadingly, so if only the hour is passed, then minute, sec, usec, and nsec is set to 0. If the hour and minute is passed, then sec, usec, and nsec is set to 0. The options parameter takes a hash with any of these keys: :year, :month, :day, :hour, :min, :sec, :usec, :nsec, :offset, :zone. Pass either :usec or :nsec, not both. Similarly, pass either :zone or :offset, not both.

      t = Time.zone.now          # => Fri, 14 Apr 2017 11:45:15.116992711 EST -05:00
       t.change(year: 2020)       # => Tue, 14 Apr 2020 11:45:15.116992711 EST -05:00
      @@ -1403,7 +1403,7 @@ 

      -

      Returns the simultaneous time in Time.zone, or the specified zone.

      +

      Returns the simultaneous time in Time.zone, or the specified zone.

      @@ -1591,7 +1591,7 @@

      -

      Returns a Time instance of the simultaneous time in the system timezone.

      +

      Returns a Time instance of the simultaneous time in the system timezone.

      @@ -1700,7 +1700,7 @@

      -

      Send the missing method to time instance, and wrap result in a new TimeWithZone with the existing time_zone.

      +

      Send the missing method to time instance, and wrap result in a new TimeWithZone with the existing time_zone.

      @@ -2083,7 +2083,7 @@

      -

      Returns a Time instance that represents the time in time_zone.

      +

      Returns a Time instance that represents the time in time_zone.

      @@ -2261,7 +2261,7 @@

      Returns a string of the object’s date and time.

      -

      This method is aliased to to_formatted_s.

      +

      This method is aliased to to_formatted_s.

      Accepts an optional format:

      • @@ -2431,7 +2431,7 @@

        -

        Returns an instance of Time, either with the same UTC offset as self or in the local system timezone depending on the setting of ActiveSupport.to_time_preserves_timezone.

        +

        Returns an instance of Time, either with the same UTC offset as self or in the local system timezone depending on the setting of ActiveSupport.to_time_preserves_timezone.

        @@ -2569,7 +2569,7 @@

        -

        Returns a Time instance of the simultaneous time in the UTC timezone.

        +

        Returns a Time instance of the simultaneous time in the UTC timezone.

        diff --git a/src/7.1/classes/ActiveSupport/TimeZone.html b/src/7.1/classes/ActiveSupport/TimeZone.html index aa8393e1e3..9fb3d45554 100644 --- a/src/7.1/classes/ActiveSupport/TimeZone.html +++ b/src/7.1/classes/ActiveSupport/TimeZone.html @@ -42,7 +42,7 @@

        Active Sup

        Create ActiveSupport::TimeWithZone instances via TimeZone’s local, parse, at, and now methods.

      -

      If you set config.time_zone in the Rails Application, you can access this TimeZone object via Time.zone:

      +

      If you set config.time_zone in the Rails Application, you can access this TimeZone object via Time.zone:

      # application.rb:
       class Application < Rails::Application
      diff --git a/src/7.1/classes/Array.html b/src/7.1/classes/Array.html
      index a3807d9009..6ad50bb2bb 100644
      --- a/src/7.1/classes/Array.html
      +++ b/src/7.1/classes/Array.html
      @@ -211,9 +211,9 @@ 

      This method is similar in purpose to Kernel#Array, but there are some differences:

      • -

        If the argument responds to to_ary the method is invoked. Kernel#Array moves on to try to_a if the returned value is nil, but Array.wrap returns an array with the argument as its single element right away.

        +

        If the argument responds to to_ary the method is invoked. Kernel#Array moves on to try to_a if the returned value is nil, but Array.wrap returns an array with the argument as its single element right away.

      • -

        If the returned value from to_ary is neither nil nor an Array object, Kernel#Array raises an exception, while Array.wrap does not, it just returns the value.

        +

        If the returned value from to_ary is neither nil nor an Array object, Kernel#Array raises an exception, while Array.wrap does not, it just returns the value.

      • It does not call to_a on the argument, if the argument does not respond to to_ary it returns an array with the argument as its single element.

      @@ -325,7 +325,7 @@

      [ [ 0, 1 ], [ 1, 0 ] ].excluding([ [ 1, 0 ] ]) # => [ [ 0, 1 ] ]

      -

      Note: This is an optimization of Enumerable#excluding that uses Array#- instead of Array#reject for performance reasons.

      +

      Note: This is an optimization of Enumerable#excluding that uses Array#- instead of Array#reject for performance reasons.

      @@ -1121,7 +1121,7 @@

      Extends Array#to_s to convert a collection of elements into a comma separated id list if :db argument is given as the format.

      -

      This method is aliased to to_formatted_s.

      +

      This method is aliased to to_formatted_s.

      Blog.all.to_fs(:db)  # => "1,2,3"
       Blog.none.to_fs(:db) # => "null"
      @@ -1174,7 +1174,7 @@ 

      -

      Calls to_param on all its elements and joins the result with slashes. This is used by url_for in Action Pack.

      +

      Calls to_param on all its elements and joins the result with slashes. This is used by url_for in Action Pack.

      @@ -1358,9 +1358,9 @@

      -

      Returns a string that represents the array in XML by invoking to_xml on each element. Active Record collections delegate their representation in XML to this method.

      +

      Returns a string that represents the array in XML by invoking to_xml on each element. Active Record collections delegate their representation in XML to this method.

      -

      All elements are expected to respond to to_xml, if any of them does not then an exception is raised.

      +

      All elements are expected to respond to to_xml, if any of them does not then an exception is raised.

      The root node reflects the class name of the first element in plural if all elements belong to the same type and that’s not Hash:

      diff --git a/src/7.1/classes/Class.html b/src/7.1/classes/Class.html index 0e225b4125..8db06e4295 100644 --- a/src/7.1/classes/Class.html +++ b/src/7.1/classes/Class.html @@ -115,7 +115,7 @@

      Examples

      In the above case as long as Subclass does not assign a value to setting by performing Subclass.setting = something, Subclass.setting would read value assigned to parent class. Once Subclass assigns a value then the value assigned by Subclass would be returned.

      -

      This matches normal Ruby method inheritance: think of writing an attribute on a subclass as overriding the reader method. However, you need to be aware when using class_attribute with mutable structures as Array or Hash. In such cases, you don’t want to do changes in place. Instead use setters:

      +

      This matches normal Ruby method inheritance: think of writing an attribute on a subclass as overriding the reader method. However, you need to be aware when using class_attribute with mutable structures as Array or Hash. In such cases, you don’t want to do changes in place. Instead use setters:

      Base.setting = []
       Base.setting                # => []
      diff --git a/src/7.1/classes/Date.html b/src/7.1/classes/Date.html
      index a3021dc084..d1f840da67 100644
      --- a/src/7.1/classes/Date.html
      +++ b/src/7.1/classes/Date.html
      @@ -274,7 +274,7 @@ 

      -

      Returns the week start (e.g. :monday) for the current request, if this has been set (via Date.beginning_of_week=). If Date.beginning_of_week has not been set for the current request, returns the week start specified in config.beginning_of_week. If no config.beginning_of_week was specified, returns :monday.

      +

      Returns the week start (e.g. :monday) for the current request, if this has been set (via Date.beginning_of_week=). If Date.beginning_of_week has not been set for the current request, returns the week start specified in config.beginning_of_week. If no config.beginning_of_week was specified, returns :monday.

      @@ -309,7 +309,7 @@

      -

      Sets Date.beginning_of_week to a week start (e.g. :monday) for current request/thread.

      +

      Sets Date.beginning_of_week to a week start (e.g. :monday) for current request/thread.

      This method accepts any of the following day symbols: :monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday

      @@ -346,7 +346,7 @@

      -

      Returns Time.zone.today when Time.zone or config.time_zone are set, otherwise just returns Date.today.

      +

      Returns Time.zone.today when Time.zone or config.time_zone are set, otherwise just returns Date.today.

      @@ -1281,7 +1281,7 @@

      Convert to a formatted string. See DATE_FORMATS for predefined formats.

      -

      This method is aliased to to_formatted_s.

      +

      This method is aliased to to_formatted_s.

      date = Date.new(2007, 11, 10)       # => Sat, 10 Nov 2007
       
      diff --git a/src/7.1/classes/DateAndTime/Calculations.html b/src/7.1/classes/DateAndTime/Calculations.html
      index 9c28e9e689..b33104acef 100644
      --- a/src/7.1/classes/DateAndTime/Calculations.html
      +++ b/src/7.1/classes/DateAndTime/Calculations.html
      @@ -466,7 +466,7 @@ 

      -

      Returns a Range representing the whole week of the current date/time. Week starts on start_day, default is Date.beginning_of_week or config.beginning_of_week when set.

      +

      Returns a Range representing the whole week of the current date/time. Week starts on start_day, default is Date.beginning_of_week or config.beginning_of_week when set.

      @@ -777,7 +777,7 @@

      today.beginning_of_month # => Mon, 01 Jun 2015

      -

      DateTime objects will have a time set to 0:00.

      +

      DateTime objects will have a time set to 0:00.

      now = DateTime.current # => Thu, 18 Jun 2015 15:23:13 +0000
       now.beginning_of_month # => Mon, 01 Jun 2015 00:00:00 +0000
      @@ -826,7 +826,7 @@ 

      today.beginning_of_quarter # => Wed, 01 Jul 2015

      -

      DateTime objects will have a time set to 0:00.

      +

      DateTime objects will have a time set to 0:00.

      now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000
       now.beginning_of_quarter # => Wed, 01 Jul 2015 00:00:00 +0000
      @@ -870,7 +870,7 @@ 

      -

      Returns a new date/time representing the start of this week on the given day. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. DateTime objects have their time set to 0:00.

      +

      Returns a new date/time representing the start of this week on the given day. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. DateTime objects have their time set to 0:00.

      @@ -916,7 +916,7 @@

      today.beginning_of_year # => Thu, 01 Jan 2015

      -

      DateTime objects will have a time set to 0:00.

      +

      DateTime objects will have a time set to 0:00.

      now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000
       now.beginning_of_year # => Thu, 01 Jan 2015 00:00:00 +0000
      @@ -1029,7 +1029,7 @@ 

      -

      Returns the number of days to the start of the week on the given day. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set.

      +

      Returns the number of days to the start of the week on the given day. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set.

      @@ -1111,7 +1111,7 @@

      today.end_of_quarter # => Wed, 30 Sep 2015

      -

      DateTime objects will have a time set to 23:59:59.

      +

      DateTime objects will have a time set to 23:59:59.

      now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000
       now.end_of_quarter # => Wed, 30 Sep 2015 23:59:59 +0000
      @@ -1155,7 +1155,7 @@ 

      -

      Returns a new date/time representing the end of this week on the given day. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. DateTime objects have their time set to 23:59:59.

      +

      Returns a new date/time representing the end of this week on the given day. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. DateTime objects have their time set to 23:59:59.

      @@ -1413,7 +1413,7 @@

      -

      Returns Monday of this week assuming that week starts on Monday. DateTime objects have their time set to 0:00.

      +

      Returns Monday of this week assuming that week starts on Monday. DateTime objects have their time set to 0:00.

      @@ -1626,13 +1626,13 @@

      today.next_week # => Mon, 11 May 2015

      -

      The given_day_in_next_week defaults to the beginning of the week which is determined by Date.beginning_of_week or config.beginning_of_week when set.

      +

      The given_day_in_next_week defaults to the beginning of the week which is determined by Date.beginning_of_week or config.beginning_of_week when set.

      today = Date.today       # => Thu, 07 May 2015
       today.next_week(:friday) # => Fri, 15 May 2015
       
      -

      DateTime objects have their time set to 0:00 unless same_time is true.

      +

      DateTime objects have their time set to 0:00 unless same_time is true.

      now = DateTime.current # => Thu, 07 May 2015 13:31:16 +0000
       now.next_week      # => Mon, 11 May 2015 00:00:00 +0000
      @@ -1922,7 +1922,7 @@ 

      -

      Returns a new date/time representing the given day in the previous week. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. DateTime objects have their time set to 0:00 unless same_time is true.

      +

      Returns a new date/time representing the given day in the previous week. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. DateTime objects have their time set to 0:00 unless same_time is true.

      @@ -2046,7 +2046,7 @@

      -

      Returns Sunday of this week assuming that week starts on Monday. DateTime objects have their time set to 23:59:59.

      +

      Returns Sunday of this week assuming that week starts on Monday. DateTime objects have their time set to 23:59:59.

      diff --git a/src/7.1/classes/DateAndTime/Zones.html b/src/7.1/classes/DateAndTime/Zones.html index bc598b6d85..b804709daf 100644 --- a/src/7.1/classes/DateAndTime/Zones.html +++ b/src/7.1/classes/DateAndTime/Zones.html @@ -66,16 +66,16 @@

      -

      Returns the simultaneous time in Time.zone if a zone is given or if Time.zone_default is set. Otherwise, it returns the current time.

      +

      Returns the simultaneous time in Time.zone if a zone is given or if Time.zone_default is set. Otherwise, it returns the current time.

      Time.zone = 'Hawaii'        # => 'Hawaii'
       Time.utc(2000).in_time_zone # => Fri, 31 Dec 1999 14:00:00 HST -10:00
       Date.new(2000).in_time_zone # => Sat, 01 Jan 2000 00:00:00 HST -10:00
       
      -

      This method is similar to Time#localtime, except that it uses Time.zone as the local zone instead of the operating system’s time zone.

      +

      This method is similar to Time#localtime, except that it uses Time.zone as the local zone instead of the operating system’s time zone.

      -

      You can also pass in a TimeZone instance or string that identifies a TimeZone as an argument, and the conversion will be based on that zone instead of Time.zone.

      +

      You can also pass in a TimeZone instance or string that identifies a TimeZone as an argument, and the conversion will be based on that zone instead of Time.zone.

      Time.utc(2000).in_time_zone('Alaska') # => Fri, 31 Dec 1999 15:00:00 AKST -09:00
       Date.new(2000).in_time_zone('Alaska') # => Sat, 01 Jan 2000 00:00:00 AKST -09:00
      diff --git a/src/7.1/classes/DateTime.html b/src/7.1/classes/DateTime.html
      index 104b798c4f..41b1a1658c 100644
      --- a/src/7.1/classes/DateTime.html
      +++ b/src/7.1/classes/DateTime.html
      @@ -345,7 +345,7 @@ 

      -

      Returns Time.zone.now.to_datetime when Time.zone or config.time_zone are set, otherwise returns Time.now.to_datetime.

      +

      Returns Time.zone.now.to_datetime when Time.zone or config.time_zone are set, otherwise returns Time.now.to_datetime.

      @@ -1348,7 +1348,7 @@

      -

      Returns a Time instance of the simultaneous time in the system timezone.

      +

      Returns a Time instance of the simultaneous time in the system timezone.

      @@ -1799,7 +1799,7 @@

      Convert to a formatted string. See Time::DATE_FORMATS for predefined formats.

      -

      This method is aliased to to_formatted_s.

      +

      This method is aliased to to_formatted_s.

      Examples

      @@ -1900,7 +1900,7 @@

      -

      Either return an instance of Time with the same UTC offset as self or an instance of Time representing the same time in the local system timezone depending on the setting of on the setting of ActiveSupport.to_time_preserves_timezone.

      +

      Either return an instance of Time with the same UTC offset as self or an instance of Time representing the same time in the local system timezone depending on the setting of on the setting of ActiveSupport.to_time_preserves_timezone.

      @@ -1970,7 +1970,7 @@

      -

      Returns a Time instance of the simultaneous time in the UTC timezone.

      +

      Returns a Time instance of the simultaneous time in the UTC timezone.

      DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24))     # => Mon, 21 Feb 2005 10:11:12 -0600
       DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC
      diff --git a/src/7.1/classes/ERB/Util.html b/src/7.1/classes/ERB/Util.html
      index ac9d461643..ff5f40fc1a 100644
      --- a/src/7.1/classes/ERB/Util.html
      +++ b/src/7.1/classes/ERB/Util.html
      @@ -203,7 +203,7 @@ 

      </script>

      -

      It is necessary to raw the result of json_escape, so that quotation marks don’t get converted to &quot; entities. json_escape doesn’t automatically flag the result as HTML safe, since the raw value is unsafe to use inside HTML attributes.

      +

      It is necessary to raw the result of json_escape, so that quotation marks don’t get converted to &quot; entities. json_escape doesn’t automatically flag the result as HTML safe, since the raw value is unsafe to use inside HTML attributes.

      If your JSON is being used downstream for insertion into the DOM, be aware of whether or not it is being inserted via html(). Most jQuery plugins do this. If that is the case, be sure to html_escape or sanitize any user-generated content returned by your JSON.

      diff --git a/src/7.1/classes/Enumerable.html b/src/7.1/classes/Enumerable.html index a468c17611..988e5b9edd 100644 --- a/src/7.1/classes/Enumerable.html +++ b/src/7.1/classes/Enumerable.html @@ -133,7 +133,7 @@

      -

      Returns a new Array without the blank items. Uses Object#blank? for determining if an item is blank.

      +

      Returns a new Array without the blank items. Uses Object#blank? for determining if an item is blank.

      [1, "", nil, 2, " ", [], {}, false, true].compact_blank
       # =>  [1, 2, true]
      @@ -142,7 +142,7 @@ 

      # => [1]

      -

      When called on a Hash, returns a new Hash without the blank values.

      +

      When called on a Hash, returns a new Hash without the blank values.

      { a: "", b: 1, c: nil, d: [], e: false, f: true }.compact_blank
       # => { b: 1, f: true }
      @@ -266,7 +266,7 @@ 

      -

      Returns a new Array where the order has been set to that provided in the series, based on the key of the objects in the original enumerable.

      +

      Returns a new Array where the order has been set to that provided in the series, based on the key of the objects in the original enumerable.

      [ Person.find(5), Person.find(3), Person.find(1) ].in_order_of(:id, [ 1, 5, 3 ])
       # => [ Person.find(1), Person.find(5), Person.find(3) ]
      @@ -670,7 +670,7 @@ 

      -

      Returns the sole item in the enumerable. If there are no items, or more than one item, raises Enumerable::SoleItemExpectedError.

      +

      Returns the sole item in the enumerable. If there are no items, or more than one item, raises Enumerable::SoleItemExpectedError.

      ["x"].sole          # => "x"
       Set.new.sole        # => Enumerable::SoleItemExpectedError: no item found
      diff --git a/src/7.1/classes/Hash.html b/src/7.1/classes/Hash.html
      index aebf3ae02e..8077314321 100644
      --- a/src/7.1/classes/Hash.html
      +++ b/src/7.1/classes/Hash.html
      @@ -233,7 +233,7 @@ 

      -

      Builds a Hash from XML just like Hash.from_xml, but also allows Symbol and YAML.

      +

      Builds a Hash from XML just like Hash.from_xml, but also allows Symbol and YAML.

      @@ -282,7 +282,7 @@

      # => {"hash"=>{"foo"=>1, "bar"=>2}}

      -

      DisallowedType is raised if the XML contains attributes with type="yaml" or type="symbol". Use Hash.from_trusted_xml to parse this XML.

      +

      DisallowedType is raised if the XML contains attributes with type="yaml" or type="symbol". Use Hash.from_trusted_xml to parse this XML.

      Custom disallowed_types can also be passed in the form of an array.

      @@ -384,7 +384,7 @@

      -

      Removes all blank values from the Hash in place and returns self. Uses Object#blank? for determining if a value is blank.

      +

      Removes all blank values from the Hash in place and returns self. Uses Object#blank? for determining if a value is blank.

      h = { a: "", b: 1, c: nil, d: [], e: false, f: true }
       h.compact_blank!
      @@ -1060,7 +1060,7 @@ 

      -

      Destructive reverse_merge.

      +

      Destructive reverse_merge.

      @@ -1210,7 +1210,7 @@

      -

      Destructively converts all keys to strings. Same as stringify_keys, but modifies self.

      +

      Destructively converts all keys to strings. Same as stringify_keys, but modifies self.

      @@ -1290,7 +1290,7 @@

      -

      Destructively converts all keys to symbols, as long as they respond to to_sym. Same as symbolize_keys, but modifies self.

      +

      Destructively converts all keys to symbols, as long as they respond to to_sym. Same as symbolize_keys, but modifies self.

      @@ -1485,7 +1485,7 @@

      # => "<b>foo</b>"

    • -

      If value responds to to_xml the method is invoked with key as :root.

      +

      If value responds to to_xml the method is invoked with key as :root.

      class Foo
         def to_xml(options)
      diff --git a/src/7.1/classes/Module.html b/src/7.1/classes/Module.html
      index fa4dda54d6..8ce269ae4b 100644
      --- a/src/7.1/classes/Module.html
      +++ b/src/7.1/classes/Module.html
      @@ -63,7 +63,7 @@ 

      Attribute Accessors p

      So the values are scoped within the Thread.current space under the class name of the module.

      -

      Note that it can also be scoped per-fiber if Rails.application.config.active_support.isolation_level is set to :fiber.

      +

      Note that it can also be scoped per-fiber if Rails.application.config.active_support.isolation_level is set to :fiber.

    @@ -670,7 +670,7 @@

    Options

  • :prefix - Prefixes the new method with the target name or a custom prefix

  • -

    :allow_nil - If set to true, prevents a Module::DelegationError from being raised

    +

    :allow_nil - If set to true, prevents a Module::DelegationError from being raised

  • :private - If set to true, changes method visibility to private

  • @@ -782,7 +782,7 @@

    Options

    User.new.age # => 2

    -

    If the target is nil and does not respond to the delegated method a Module::DelegationError is raised. If you wish to instead return nil, use the :allow_nil option.

    +

    If the target is nil and does not respond to the delegated method a Module::DelegationError is raised. If you wish to instead return nil, use the :allow_nil option.

    class User < ActiveRecord::Base
       has_one :profile
    @@ -970,7 +970,7 @@ 

    end

    -

    With Module#delegate_missing_to, the above is condensed to:

    +

    With Module#delegate_missing_to, the above is condensed to:

    class Partition
       delegate_missing_to :@event
    @@ -987,7 +987,7 @@ 

    The target can be anything callable within the object, e.g. instance variables, methods, constants, etc.

    -

    The delegated method must be public on the target, otherwise it will raise DelegationError. If you wish to instead return nil, use the :allow_nil option.

    +

    The delegated method must be public on the target, otherwise it will raise DelegationError. If you wish to instead return nil, use the :allow_nil option.

    The marshal_dump and _dump methods are exempt from delegation due to possible interference when calling Marshal.dump(object), should the delegation target method of object add or remove instance variables.

    @@ -1800,7 +1800,7 @@

    Account.new.user # => "DHH" -

    Unlike mattr_accessor, values are not shared with subclasses or parent classes. If a subclass changes the value, the parent class’ value is not changed. If the parent class changes the value, the value of subclasses is not changed.

    +

    Unlike mattr_accessor, values are not shared with subclasses or parent classes. If a subclass changes the value, the parent class’ value is not changed. If the parent class changes the value, the value of subclasses is not changed.

    class Customer < Account
     end
    diff --git a/src/7.1/classes/Object.html b/src/7.1/classes/Object.html
    index 24f2b64825..3a0c954991 100644
    --- a/src/7.1/classes/Object.html
    +++ b/src/7.1/classes/Object.html
    @@ -193,11 +193,11 @@ 

    A class that provides the same interface as SomeClass may define a marker method named acts_like_some_class? to signal its compatibility to callers of acts_like?(:some_class).

    -

    For example, Active Support extends Date to define an acts_like_date? method, and extends Time to define acts_like_time?. As a result, developers can call x.acts_like?(:time) and x.acts_like?(:date) to test duck-type compatibility, and classes that are able to act like Time can also define an acts_like_time? method to interoperate.

    +

    For example, Active Support extends Date to define an acts_like_date? method, and extends Time to define acts_like_time?. As a result, developers can call x.acts_like?(:time) and x.acts_like?(:date) to test duck-type compatibility, and classes that are able to act like Time can also define an acts_like_time? method to interoperate.

    Note that the marker method is only expected to exist. It isn’t called, so its body or return value are irrelevant.

    -

    Example: A class that provides the same interface as String

    +

    Example: A class that provides the same interface as String

    This class may define:

    @@ -418,13 +418,13 @@

    Returns true if this object is included in the argument.

    -

    When argument is a Range, #cover? is used to properly handle inclusion check within open ranges. Otherwise, argument must be any object which responds to #include?. Usage:

    +

    When argument is a Range, cover? is used to properly handle inclusion check within open ranges. Otherwise, argument must be any object which responds to include?. Usage:

    characters = ["Konata", "Kagami", "Tsukasa"]
     "Konata".in?(characters) # => true
     
    -

    For non Range arguments, this will throw an ArgumentError if the argument doesn’t respond to #include?.

    +

    For non Range arguments, this will throw an ArgumentError if the argument doesn’t respond to include?.

    @@ -608,12 +608,12 @@

    -

    Returns the receiver if it’s included in the argument otherwise returns nil. Argument must be any object which responds to #include?. Usage:

    +

    Returns the receiver if it’s included in the argument otherwise returns nil. Argument must be any object which responds to include?. Usage:

    params[:bucket_type].presence_in %w( project calendar )
     
    -

    This will throw an ArgumentError if the argument doesn’t respond to #include?.

    +

    This will throw an ArgumentError if the argument doesn’t respond to include?.

    @return [Object]

    @@ -816,7 +816,7 @@

    @person.try { upcase.truncate(50) }
     
    -

    Please also note that try is defined on Object. Therefore, it won’t work with instances of classes that do not have Object among their ancestors, like direct subclasses of BasicObject.

    +

    Please also note that try is defined on Object. Therefore, it won’t work with instances of classes that do not have Object among their ancestors, like direct subclasses of BasicObject.

    @@ -934,9 +934,9 @@

    -

    An elegant way to factor duplication out of options passed to a series of method calls. Each method called in the block, with the block variable as the receiver, will have its options merged with the default options Hash or Hash-like object provided. Each method called on the block variable must take an options hash as its final argument.

    +

    An elegant way to factor duplication out of options passed to a series of method calls. Each method called in the block, with the block variable as the receiver, will have its options merged with the default options Hash or Hash-like object provided. Each method called on the block variable must take an options hash as its final argument.

    -

    Without with_options, this code contains duplication:

    +

    Without with_options, this code contains duplication:

    class Account < ActiveRecord::Base
       has_many :customers, dependent: :destroy
    @@ -946,7 +946,7 @@ 

    end

    -

    Using with_options, we can remove the duplication:

    +

    Using with_options, we can remove the duplication:

    class Account < ActiveRecord::Base
       with_options dependent: :destroy do |assoc|
    @@ -978,7 +978,7 @@ 

    end

    -

    with_options can also be nested since the call is forwarded to its receiver.

    +

    with_options can also be nested since the call is forwarded to its receiver.

    NOTE: Each nesting level will merge inherited defaults in addition to their own.

    @@ -996,7 +996,7 @@

    Hence the inherited default for if key is ignored.

    -

    NOTE: You cannot call class methods implicitly inside of with_options. You can access these methods using the class name instead:

    +

    NOTE: You cannot call class methods implicitly inside of with_options. You can access these methods using the class name instead:

    class Phone < ActiveRecord::Base
       enum :phone_number_type, { home: 0, office: 1, mobile: 2 }
    diff --git a/src/7.1/classes/Rails/Application.html b/src/7.1/classes/Rails/Application.html
    index 3f0406f2d9..056f703ae7 100644
    --- a/src/7.1/classes/Rails/Application.html
    +++ b/src/7.1/classes/Rails/Application.html
    @@ -67,7 +67,7 @@ 

    Booting process

  • require railties and engines.

  • -

    Define Rails.application as class MyApp::Application < Rails::Application.

    +

    Define Rails.application as class MyApp::Application < Rails::Application.

  • Run config.before_configuration callbacks.

  • @@ -77,11 +77,11 @@

    Booting process

  • Run Railtie#initializer defined by railties, engines, and application. One by one, each engine sets up its load paths and routes, and runs its config/initializers/* files.

  • -

    Custom Railtie#initializers added by railties, engines, and applications are executed.

    +

    Custom Railtie#initializers added by railties, engines, and applications are executed.

  • Build the middleware stack and run to_prepare callbacks.

  • -

    Run config.before_eager_load and eager_load! if eager_load is true.

    +

    Run config.before_eager_load and eager_load! if eager_load is true.

  • Run config.after_initialize callbacks.

  • @@ -1015,7 +1015,7 @@

    -

    Sends the isolate_namespace method up to the class method.

    +

    Sends the isolate_namespace method up to the class method.

    @@ -1050,7 +1050,7 @@

    -

    Returns a key generator (ActiveSupport::CachingKeyGenerator) for a specified secret_key_base. The return value is memoized, so additional calls with the same secret_key_base will return the same key generator instance.

    +

    Returns a key generator (ActiveSupport::CachingKeyGenerator) for a specified secret_key_base. The return value is memoized, so additional calls with the same secret_key_base will return the same key generator instance.

    @@ -1153,7 +1153,7 @@

    end

    -

    Message verifiers created by this factory will always use a secret derived from secret_key_base when generating messages. clear_rotations will not affect this behavior. However, older secret_key_base values can be rotated for verifying messages:

    +

    Message verifiers created by this factory will always use a secret derived from secret_key_base when generating messages. clear_rotations will not affect this behavior. However, older secret_key_base values can be rotated for verifying messages:

    # Fall back to old `secret_key_base` when verifying messages
     config.before_initialize do |app|
    diff --git a/src/7.1/classes/Rails/Application/Configuration.html b/src/7.1/classes/Rails/Application/Configuration.html
    index bc70400000..4fda877be1 100644
    --- a/src/7.1/classes/Rails/Application/Configuration.html
    +++ b/src/7.1/classes/Rails/Application/Configuration.html
    @@ -1679,13 +1679,13 @@ 

    Specifies what class to use to store the session. Possible values are :cache_store, :cookie_store, :mem_cache_store, a custom store, or :disabled. :disabled tells Rails not to deal with sessions.

    -

    Additional options will be set as session_options:

    +

    Additional options will be set as session_options:

    config.session_store :cookie_store, key: "_your_app_session"
     config.session_options # => {key: "_your_app_session"}
     
    -

    If a custom store is specified as a symbol, it will be resolved to the ActionDispatch::Session namespace:

    +

    If a custom store is specified as a symbol, it will be resolved to the ActionDispatch::Session namespace:

    # use ActionDispatch::Session::MyCustomStore as the session store
     config.session_store :my_custom_store
    diff --git a/src/7.1/classes/Rails/Configuration/MiddlewareStackProxy.html b/src/7.1/classes/Rails/Configuration/MiddlewareStackProxy.html
    index 496ea2abee..57a20a2359 100644
    --- a/src/7.1/classes/Rails/Configuration/MiddlewareStackProxy.html
    +++ b/src/7.1/classes/Rails/Configuration/MiddlewareStackProxy.html
    @@ -36,12 +36,12 @@ 

    config.middleware.use Magical::Unicorns
     
    -

    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:

    +

    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 Rack::Head, Magical::Unicorns
     
    -

    There’s also insert_after which will insert a middleware after another:

    +

    There’s also insert_after which will insert a middleware after another:

    config.middleware.insert_after Rack::Head, Magical::Unicorns
     
    @@ -56,7 +56,7 @@

    config.middleware.move_before ActionDispatch::Flash, Magical::Unicorns
     
    -

    This will move the Magical::Unicorns middleware before the ActionDispatch::Flash. You can also move it after:

    +

    This will move the Magical::Unicorns middleware before the ActionDispatch::Flash. You can also move it after:

    config.middleware.move_after ActionDispatch::Flash, Magical::Unicorns
     
    diff --git a/src/7.1/classes/Rails/Engine.html b/src/7.1/classes/Rails/Engine.html index 79e294a4e3..a53178e498 100644 --- a/src/7.1/classes/Rails/Engine.html +++ b/src/7.1/classes/Rails/Engine.html @@ -35,13 +35,13 @@

    -

    Rails::Engine allows you to wrap a specific Rails application or subset of functionality and share it with other applications or within a larger packaged application. Every Rails::Application is just an engine, which allows for simple feature and application sharing.

    +

    Rails::Engine allows you to wrap a specific Rails application or subset of functionality and share it with other applications or within a larger packaged application. Every Rails::Application is just an engine, which allows for simple feature and application sharing.

    -

    Any Rails::Engine is also a Rails::Railtie, so the same methods (like rake_tasks and generators) and configuration options that are available in railties can also be used in engines.

    +

    Any Rails::Engine is also a Rails::Railtie, so the same methods (like rake_tasks and generators) and configuration options that are available in railties can also be used in engines.

    Creating an Engine

    -

    If you want a gem to behave as an engine, you have to specify an Engine for it somewhere inside your plugin’s lib folder (similar to how we specify a Railtie):

    +

    If you want a gem to behave as an engine, you have to specify an Engine for it somewhere inside your plugin’s lib folder (similar to how we specify a Railtie):

    # lib/my_engine.rb
     module MyEngine
    @@ -123,11 +123,11 @@ 

    Paths end

    -

    The Application class adds a couple more paths to this set. And as in your Application, all folders under app are automatically added to the load path. If you have an app/services folder for example, it will be added by default.

    +

    The Application class adds a couple more paths to this set. And as in your Application, all folders under app are automatically added to the load path. If you have an app/services folder for example, it will be added by default.

    Endpoint

    -

    An engine can also be a Rack application. It can be useful if you have a Rack application that you would like to provide with some of the Engine‘s features.

    +

    An engine can also be a Rack application. It can be useful if you have a Rack application that you would like to provide with some of the Engine‘s features.

    To do that, use the ::endpoint method:

    @@ -147,7 +147,7 @@

    Endpoint

    Middleware stack

    -

    As an engine can now be a Rack endpoint, it can also have a middleware stack. The usage is exactly the same as in Application:

    +

    As an engine can now be a Rack endpoint, it can also have a middleware stack. The usage is exactly the same as in Application:

    module MyEngine
       class Engine < Rails::Engine
    @@ -176,7 +176,7 @@ 

    Mount priority

    end
    -

    MyEngine is mounted at /blog, and /blog/omg points to application’s controller. In such a situation, requests to /blog/omg will go through MyEngine, and if there is no such route in Engine‘s routes, it will be dispatched to main#omg. It’s much better to swap that:

    +

    MyEngine is mounted at /blog, and /blog/omg points to application’s controller. In such a situation, requests to /blog/omg will go through MyEngine, and if there is no such route in Engine‘s routes, it will be dispatched to main#omg. It’s much better to swap that:

    Rails.application.routes.draw do
       get "/blog/omg" => "main#omg"
    @@ -184,7 +184,7 @@ 

    Mount priority

    end
    -

    Now, Engine will get only requests that were not handled by Application.

    +

    Now, Engine will get only requests that were not handled by Application.

    Engine name

    @@ -252,7 +252,7 @@

    Isolated Using Engine’s routes outside Engine

    -

    Since you can now mount an engine inside application’s routes, you do not have direct access to Engine‘s url_helpers inside Application. When you mount an engine in an application’s routes, a special helper is created to allow you to do that. Consider such a scenario:

    +

    Since you can now mount an engine inside application’s routes, you do not have direct access to Engine‘s url_helpers inside Application. When you mount an engine in an application’s routes, a special helper is created to allow you to do that. Consider such a scenario:

    # config/routes.rb
     Rails.application.routes.draw do
    @@ -288,7 +288,7 @@ 

    Using
    form_for([my_engine, @user])
     
    -

    This code will use my_engine.user_path(@user) to generate the proper route.

    +

    This code will use user) at my_engine.user_path( to generate the proper route.

    Isolated engine’s helpers

    @@ -319,7 +319,7 @@

    Migrations & see

    Note that some of the migrations may be skipped if a migration with the same name already exists in application. In such a situation you must decide whether to leave that migration or rename the migration in the application and rerun copying migrations.

    -

    If your engine has migrations, you may also want to prepare data for the database in the db/seeds.rb file. You can load that data using the load_seed method, e.g.

    +

    If your engine has migrations, you may also want to prepare data for the database in the db/seeds.rb file. You can load that data using the load_seed method, e.g.

    MyEngine::Engine.load_seed
     
    diff --git a/src/7.1/classes/Rails/Generators/Actions.html b/src/7.1/classes/Rails/Generators/Actions.html index 861acd2377..557fee441b 100644 --- a/src/7.1/classes/Rails/Generators/Actions.html +++ b/src/7.1/classes/Rails/Generators/Actions.html @@ -235,7 +235,7 @@

    Adds configuration code to a Rails runtime environment.

    -

    By default, adds code inside the Application class in config/application.rb so that it applies to all environments.

    +

    By default, adds code inside the Application class in config/application.rb so that it applies to all environments.

    environment %(config.asset_host = "cdn.provider.com")
     
    @@ -337,7 +337,7 @@

    Note that this method only adds the gem to the Gemfile; it does not install the gem.

    Options

    -
    :version +
    :version

    The version constraints for the gem, specified as a string or an array of strings:

    @@ -349,7 +349,7 @@

    Options

    gem "my_gem", ">= 1.1", "< 2.0"
     
    -
    :comment +
    :comment

    Outputs a comment above the gem declaration in the Gemfile.

    @@ -362,10 +362,10 @@

    Options

    # Second line. gem "my_gem"

    -
    :group +
    :group

    The gem group in the Gemfile that the gem belongs to.

    -
    :git +
    :git

    The URL of the git repository for the gem.

    @@ -749,16 +749,16 @@

    Options

    -
    :env +
    :env

    The Rails environment in which to run the command. Defaults to ENV["RAILS_ENV"] || "development".

    -
    :abort_on_failure +
    :abort_on_failure

    Whether to halt the generator if the command exits with a non-success exit status.

    -
    :capture +
    :capture

    Whether to capture and return the output of the command.

    -
    :sudo +
    :sudo

    Whether to run the command using sudo.

    @@ -816,16 +816,16 @@

    Options

    -
    :env +
    :env

    The Rails environment in which to run the task. Defaults to ENV["RAILS_ENV"] || "development".

    -
    :abort_on_failure +
    :abort_on_failure

    Whether to halt the generator if the task exits with a non-success exit status.

    -
    :capture +
    :capture

    Whether to capture and return the output of the task.

    -
    :sudo +
    :sudo

    Whether to run the task using sudo.

    diff --git a/src/7.1/classes/Rails/Paths/Root.html b/src/7.1/classes/Rails/Paths/Root.html index 960b5ec8ac..9a03820efa 100644 --- a/src/7.1/classes/Rails/Paths/Root.html +++ b/src/7.1/classes/Rails/Paths/Root.html @@ -57,7 +57,7 @@

    root["config/routes"].inspect # => ["config/routes.rb"] -

    The add method accepts the following options as arguments: eager_load, autoload, autoload_once, and glob.

    +

    The add method accepts the following options as arguments: eager_load, autoload, autoload_once, and glob.

    Finally, the Path object also provides a few helpers:

    diff --git a/src/7.1/classes/Rails/Railtie.html b/src/7.1/classes/Rails/Railtie.html index 3ce175c702..e57fc2e03f 100644 --- a/src/7.1/classes/Rails/Railtie.html +++ b/src/7.1/classes/Rails/Railtie.html @@ -33,7 +33,7 @@

    -

    Rails::Railtie is the core of the Rails framework and provides several hooks to extend Rails and/or modify the initialization process.

    +

    Rails::Railtie is the core of the Rails framework and provides several hooks to extend Rails and/or modify the initialization process.

    Every major component of Rails (Action Mailer, Action Controller, Active Record, etc.) implements a railtie. Each of them is responsible for their own initialization. This makes Rails itself absent of any component hooks, allowing other components to be used in place of any of the Rails defaults.

    @@ -54,7 +54,7 @@

    Creating a Railtie

    -

    To extend Rails using a railtie, create a subclass of Rails::Railtie. This class must be loaded during the Rails boot process, and is conventionally called MyNamespace::Railtie.

    +

    To extend Rails using a railtie, create a subclass of Rails::Railtie. This class must be loaded during the Rails boot process, and is conventionally called MyNamespace::Railtie.

    The following example demonstrates an extension which can be used with or without Rails.

    @@ -108,7 +108,7 @@

    Loading Rake Tasks and Generators

    -

    If your railtie has Rake tasks, you can tell Rails to load them through the method rake_tasks:

    +

    If your railtie has Rake tasks, you can tell Rails to load them through the method rake_tasks:

    class MyGem::Railtie < Rails::Railtie
       rake_tasks do
    diff --git a/src/7.1/classes/Rails/SourceAnnotationExtractor.html b/src/7.1/classes/Rails/SourceAnnotationExtractor.html
    index ed7027e259..3bbca0ff33 100644
    --- a/src/7.1/classes/Rails/SourceAnnotationExtractor.html
    +++ b/src/7.1/classes/Rails/SourceAnnotationExtractor.html
    @@ -295,7 +295,7 @@ 

    -

    Returns a hash that maps filenames under dir (recursively) to arrays with their annotations. Files with extensions registered in Rails::SourceAnnotationExtractor::Annotation.extensions are taken into account. Only files with annotations are included.

    +

    Returns a hash that maps filenames under dir (recursively) to arrays with their annotations. Files with extensions registered in Rails::SourceAnnotationExtractor::Annotation.extensions are taken into account. Only files with annotations are included.

    diff --git a/src/7.1/classes/String.html b/src/7.1/classes/String.html index 5d713e8b35..ea9bb317c2 100644 --- a/src/7.1/classes/String.html +++ b/src/7.1/classes/String.html @@ -307,7 +307,7 @@

    -

    Enables more predictable duck-typing on String-like classes. See Object#acts_like?.

    +

    Enables more predictable duck-typing on String-like classes. See Object#acts_like?.

    @@ -1317,7 +1317,7 @@

    Multibyte proxy

    -

    mb_chars is a multibyte safe proxy for string methods.

    +

    mb_chars is a multibyte safe proxy for string methods.

    It creates and returns an instance of the ActiveSupport::Multibyte::Chars class which encapsulates the original string. A Unicode safe version of all the String methods are defined on this proxy class. If the proxy class doesn’t respond to a certain method, it’s forwarded to the encapsulated string.

    @@ -1587,7 +1587,7 @@

    -

    safe_constantize tries to find a declared constant with the name specified in the string. It returns nil when the name is not in CamelCase or is not initialized.

    +

    safe_constantize tries to find a declared constant with the name specified in the string. It returns nil when the name is not in CamelCase or is not initialized.

    'Module'.safe_constantize  # => Module
     'Class'.safe_constantize   # => Class
    diff --git a/src/7.1/classes/Time.html b/src/7.1/classes/Time.html
    index 9004c96534..355bf8fdbc 100644
    --- a/src/7.1/classes/Time.html
    +++ b/src/7.1/classes/Time.html
    @@ -558,7 +558,7 @@ 

    -

    Returns Time.zone.now when Time.zone or config.time_zone are set, otherwise just returns Time.now.

    +

    Returns Time.zone.now when Time.zone or config.time_zone are set, otherwise just returns Time.now.

    @@ -667,7 +667,7 @@

    -

    Returns a TimeZone instance matching the time zone provided. Accepts the time zone in any format supported by Time.zone=. Returns nil for invalid time zones.

    +

    Returns a TimeZone instance matching the time zone provided. Accepts the time zone in any format supported by Time.zone=. Returns nil for invalid time zones.

    Time.find_zone "America/New_York" # => #<ActiveSupport::TimeZone @name="America/New_York" ...>
     Time.find_zone "NOT-A-TIMEZONE"   # => nil
    @@ -706,7 +706,7 @@ 

    -

    Returns a TimeZone instance matching the time zone provided. Accepts the time zone in any format supported by Time.zone=. Raises an ArgumentError for invalid time zones.

    +

    Returns a TimeZone instance matching the time zone provided. Accepts the time zone in any format supported by Time.zone=. Raises an ArgumentError for invalid time zones.

    Time.find_zone! "America/New_York" # => #<ActiveSupport::TimeZone @name="America/New_York" ...>
     Time.find_zone! "EST"              # => #<ActiveSupport::TimeZone @name="EST" ...>
    @@ -751,7 +751,7 @@ 

    -

    Creates a Time instance from an RFC 3339 string.

    +

    Creates a Time instance from an RFC 3339 string.

    Time.rfc3339('1999-12-31T14:00:00-10:00') # => 2000-01-01 00:00:00 -1000
     
    @@ -806,7 +806,7 @@

    -

    Allows override of Time.zone locally inside supplied block; resets Time.zone to existing value when done.

    +

    Allows override of Time.zone locally inside supplied block; resets Time.zone to existing value when done.

    class ApplicationController < ActionController::Base
       around_action :set_time_zone
    @@ -859,7 +859,7 @@ 

    -

    Returns the TimeZone for the current request, if this has been set (via Time.zone=). If Time.zone has not been set for the current request, returns the TimeZone specified in config.time_zone.

    +

    Returns the TimeZone for the current request, if this has been set (via Time.zone=). If Time.zone has not been set for the current request, returns the TimeZone specified in config.time_zone.

    @@ -894,7 +894,7 @@

    -

    Sets Time.zone to a TimeZone object for the current request/thread.

    +

    Sets Time.zone to a TimeZone object for the current request/thread.

    This method accepts any of the following:

    • @@ -907,7 +907,7 @@

      An identifier for a TZInfo::Timezone object (e.g., “America/New_York”).

    -

    Here’s an example of how you might set Time.zone on a per request basis and reset it when the request is done. current_user.time_zone just needs to return a string identifying the user’s preferred time zone:

    +

    Here’s an example of how you might set Time.zone on a per request basis and reset it when the request is done. current_user.time_zone just needs to return a string identifying the user’s preferred time zone:

    class ApplicationController < ActionController::Base
       around_action :set_time_zone
    @@ -2633,7 +2633,7 @@ 

    Converts to a formatted string. See DATE_FORMATS for built-in formats.

    -

    This method is aliased to to_formatted_s.

    +

    This method is aliased to to_formatted_s.

    time = Time.now                    # => 2007-01-18 06:10:17 -06:00
     
    @@ -2649,7 +2649,7 @@ 

    time.to_fs(:iso8601) # => "2007-01-18T06:10:17-06:00"

    -

    Adding your own time formats to to_fs

    +

    Adding your own time formats to to_fs

    You can add your own formats to the Time::DATE_FORMATS hash. Use the format name as the hash key and either a strftime string or Proc instance that takes a time argument as the value.

    @@ -2699,7 +2699,7 @@

    -

    Either return self or the time in the local system timezone depending on the setting of ActiveSupport.to_time_preserves_timezone.

    +

    Either return self or the time in the local system timezone depending on the setting of ActiveSupport.to_time_preserves_timezone.

    diff --git a/src/7.1/files/activemodel/README_rdoc.html b/src/7.1/files/activemodel/README_rdoc.html index f058e90c8c..3508155130 100644 --- a/src/7.1/files/activemodel/README_rdoc.html +++ b/src/7.1/files/activemodel/README_rdoc.html @@ -32,7 +32,7 @@

    Active Model – model

    You can read more about Active Model in the Active Model Basics guide.

    -

    Prior to Rails 3.0, if a plugin or gem developer wanted to have an object interact with Action Pack helpers, it was required to either copy chunks of code from Rails, or monkey patch entire helpers to make them handle objects that did not exactly conform to the Active Record interface. This would result in code duplication and fragile applications that broke on upgrades. Active Model solves this by defining an explicit API. You can read more about the API in ActiveModel::Lint::Tests.

    +

    Prior to Rails 3.0, if a plugin or gem developer wanted to have an object interact with Action Pack helpers, it was required to either copy chunks of code from Rails, or monkey patch entire helpers to make them handle objects that did not exactly conform to the Active Record interface. This would result in code duplication and fragile applications that broke on upgrades. Active Model solves this by defining an explicit API. You can read more about the API in ActiveModel::Lint::Tests.

    Active Model provides a default module that implements the basic API required to integrate with Action Pack out of the box: ActiveModel::API.

    diff --git a/src/7.1/files/activestorage/app/models/active_storage/preview_rb.html b/src/7.1/files/activestorage/app/models/active_storage/preview_rb.html index f0700d9f58..11da9be690 100644 --- a/src/7.1/files/activestorage/app/models/active_storage/preview_rb.html +++ b/src/7.1/files/activestorage/app/models/active_storage/preview_rb.html @@ -32,7 +32,7 @@

    Active Storage Preview

    A previewer extracts a preview image from a blob. Active Storage provides previewers for videos and PDFs. ActiveStorage::Previewer::VideoPreviewer is used for videos whereas ActiveStorage::Previewer::PopplerPDFPreviewer and ActiveStorage::Previewer::MuPDFPreviewer are used for PDFs. Build custom previewers by subclassing ActiveStorage::Previewer and implementing the requisite methods. Consult the ActiveStorage::Previewer documentation for more details on what’s required of previewers.

    -

    To choose the previewer for a blob, Active Storage calls accept? on each registered previewer in order. It uses the first previewer for which accept? returns true when given the blob. In a Rails application, add or remove previewers by manipulating Rails.application.config.active_storage.previewers in an initializer:

    +

    To choose the previewer for a blob, Active Storage calls accept? on each registered previewer in order. It uses the first previewer for which accept? returns true when given the blob. In a Rails application, add or remove previewers by manipulating Rails.application.config.active_storage.previewers in an initializer:

    Rails.application.config.active_storage.previewers
     # => [ ActiveStorage::Previewer::PopplerPDFPreviewer, ActiveStorage::Previewer::MuPDFPreviewer, ActiveStorage::Previewer::VideoPreviewer ]
    diff --git a/src/7.1/files/activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread_rb.html b/src/7.1/files/activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread_rb.html
    index a500b2d89d..f9c4734721 100644
    --- a/src/7.1/files/activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread_rb.html
    +++ b/src/7.1/files/activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread_rb.html
    @@ -32,7 +32,7 @@ 

    Attribute Accessors per Thread

    So the values are scoped within the Thread.current space under the class name of the module.

    -

    Note that it can also be scoped per-fiber if Rails.application.config.active_support.isolation_level is set to :fiber.

    +

    Note that it can also be scoped per-fiber if Rails.application.config.active_support.isolation_level is set to :fiber.

    diff --git a/src/7.1/files/railties/RDOC_MAIN_md.html b/src/7.1/files/railties/RDOC_MAIN_md.html index f6b7dc4cd9..9f508bf9cb 100644 --- a/src/7.1/files/railties/RDOC_MAIN_md.html +++ b/src/7.1/files/railties/RDOC_MAIN_md.html @@ -36,7 +36,7 @@

    What’s Rails?

    Model layer

    -

    The Model layer represents the domain model (such as Account, Product, Person, Post, etc.) and encapsulates the business logic specific to your application. In Rails, database-backed model classes are derived from ActiveRecord::Base. Active Record allows you to present the data from database rows as objects and embellish these data objects 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 Active Model module.

    +

    The Model layer represents the domain model (such as Account, Product, Person, Post, etc.) and encapsulates the business logic specific to your application. In Rails, database-backed model classes are derived from ActiveRecord::Base. Active Record allows you to present the data from database rows as objects and embellish these data objects 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 Active Model module.

    View layer

    @@ -44,7 +44,7 @@

    View layer

    Controller layer

    -

    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 generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and manipulate models, and render view templates in order to generate the appropriate HTTP response. In Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and controller classes are derived from ActionController::Base. Action Dispatch and Action Controller are bundled together in Action Pack.

    +

    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 generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and manipulate models, and render view templates in order to generate the appropriate HTTP response. In Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and controller classes are derived from ActionController::Base. Action Dispatch and Action Controller are bundled together in Action Pack.

    Frameworks and libraries

    diff --git a/src/7.1/index.html b/src/7.1/index.html index f6b7dc4cd9..9f508bf9cb 100644 --- a/src/7.1/index.html +++ b/src/7.1/index.html @@ -36,7 +36,7 @@

    What’s Rails?

    Model layer

    -

    The Model layer represents the domain model (such as Account, Product, Person, Post, etc.) and encapsulates the business logic specific to your application. In Rails, database-backed model classes are derived from ActiveRecord::Base. Active Record allows you to present the data from database rows as objects and embellish these data objects 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 Active Model module.

    +

    The Model layer represents the domain model (such as Account, Product, Person, Post, etc.) and encapsulates the business logic specific to your application. In Rails, database-backed model classes are derived from ActiveRecord::Base. Active Record allows you to present the data from database rows as objects and embellish these data objects 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 Active Model module.

    View layer

    @@ -44,7 +44,7 @@

    View layer

    Controller layer

    -

    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 generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and manipulate models, and render view templates in order to generate the appropriate HTTP response. In Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and controller classes are derived from ActionController::Base. Action Dispatch and Action Controller are bundled together in Action Pack.

    +

    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 generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and manipulate models, and render view templates in order to generate the appropriate HTTP response. In Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and controller classes are derived from ActionController::Base. Action Dispatch and Action Controller are bundled together in Action Pack.

    Frameworks and libraries

    From 7738309236561e17bc556c896a2dc3c9b0894778 Mon Sep 17 00:00:00 2001 From: Toshimaru Date: Sun, 28 Sep 2025 05:07:05 +0900 Subject: [PATCH 2/2] build: Dcos for Rails 7.2 --- src/7.2/classes/AbstractController/Base.html | 6 +- .../AbstractController/Caching/Fragments.html | 8 +- .../classes/AbstractController/Rendering.html | 2 +- src/7.2/classes/ActionCable/Channel/Base.html | 2 +- .../ActionCable/Channel/ChannelStub.html | 2 +- .../Channel/Naming/ClassMethods.html | 2 +- .../classes/ActionCable/Channel/TestCase.html | 6 +- .../RemoteConnections/RemoteConnection.html | 2 +- .../ActionCable/SubscriptionAdapter/Test.html | 2 +- src/7.2/classes/ActionController/API.html | 6 +- .../AllowBrowser/ClassMethods.html | 2 +- src/7.2/classes/ActionController/Base.html | 2 +- .../ActionController/ConditionalGet.html | 28 +-- .../ActionController/DataStreaming.html | 6 +- src/7.2/classes/ActionController/Helpers.html | 2 +- .../HttpAuthentication/Token.html | 6 +- src/7.2/classes/ActionController/Live.html | 2 +- .../classes/ActionController/Live/SSE.html | 6 +- src/7.2/classes/ActionController/Metal.html | 6 +- .../ActionController/MimeResponds.html | 2 +- .../classes/ActionController/Parameters.html | 60 ++--- .../ActionController/ParamsWrapper.html | 6 +- .../ParamsWrapper/Options/ClassMethods.html | 2 +- .../RateLimiting/ClassMethods.html | 2 +- .../classes/ActionController/Redirecting.html | 12 +- .../classes/ActionController/Renderer.html | 2 +- .../classes/ActionController/Renderers.html | 4 +- .../Renderers/ClassMethods.html | 4 +- .../classes/ActionController/Rendering.html | 24 +- .../RequestForgeryProtection.html | 4 +- .../classes/ActionController/TestCase.html | 6 +- .../TestCase/Behavior/ClassMethods.html | 2 +- .../Assertions/RoutingAssertions.html | 4 +- src/7.2/classes/ActionDispatch/Cookies.html | 2 +- .../ActionDispatch/Http/Cache/Response.html | 2 +- .../ActionDispatch/Http/FilterParameters.html | 2 +- .../ActionDispatch/Integration/Session.html | 2 +- .../ActionDispatch/IntegrationTest.html | 2 +- src/7.2/classes/ActionDispatch/RemoteIp.html | 4 +- src/7.2/classes/ActionDispatch/Request.html | 14 +- .../ActionDispatch/Routing/Mapper/Base.html | 26 +- .../Routing/Mapper/CustomUrls.html | 2 +- .../Routing/Mapper/Resources.html | 20 +- .../Routing/Mapper/Scoping.html | 4 +- .../Routing/PolymorphicRoutes.html | 6 +- .../ActionDispatch/Routing/UrlFor.html | 10 +- .../ActionDispatch/Session/CacheStore.html | 2 +- .../ActionDispatch/ShowExceptions.html | 2 +- .../ActionDispatch/SystemTestCase.html | 6 +- .../TestHelpers/ScreenshotHelper.html | 4 +- src/7.2/classes/ActionMailbox.html | 2 +- src/7.2/classes/ActionMailbox/Base.html | 2 +- .../classes/ActionMailbox/InboundEmail.html | 8 +- .../InboundEmail/Incineratable.html | 2 +- .../Incineratable/Incineration.html | 2 +- .../ActionMailbox/InboundEmail/MessageId.html | 2 +- .../ActionMailbox/InboundEmail/Routable.html | 8 +- .../ActionMailbox/IncinerationJob.html | 4 +- src/7.2/classes/ActionMailer/Base.html | 26 +- src/7.2/classes/ActionMailer/FormBuilder.html | 2 +- .../classes/ActionMailer/MessageDelivery.html | 6 +- src/7.2/classes/ActionText/Attachable.html | 2 +- src/7.2/classes/ActionText/Attribute.html | 4 +- src/7.2/classes/ActionText/Content.html | 4 +- src/7.2/classes/ActionText/FixtureSet.html | 2 +- src/7.2/classes/ActionText/RichText.html | 2 +- .../ActionView/Helpers/AssetTagHelper.html | 4 +- .../ActionView/Helpers/AssetUrlHelper.html | 24 +- .../ActionView/Helpers/AtomFeedHelper.html | 2 +- .../ActionView/Helpers/CacheHelper.html | 2 +- .../ActionView/Helpers/CaptureHelper.html | 18 +- .../ActionView/Helpers/DateHelper.html | 16 +- .../ActionView/Helpers/FormBuilder.html | 22 +- .../ActionView/Helpers/FormHelper.html | 50 ++-- .../ActionView/Helpers/FormOptionsHelper.html | 18 +- .../ActionView/Helpers/FormTagHelper.html | 4 +- .../ActionView/Helpers/SanitizeHelper.html | 6 +- .../ActionView/Helpers/TextHelper.html | 20 +- .../classes/ActionView/Helpers/UrlHelper.html | 18 +- .../ActionView/Layouts/ClassMethods.html | 14 +- src/7.2/classes/ActionView/Renderer.html | 2 +- src/7.2/classes/ActionView/RoutingUrlFor.html | 4 +- src/7.2/classes/ActionView/Template.html | 10 +- src/7.2/classes/ActionView/TestCase.html | 2 +- .../classes/ActionView/TestCase/Behavior.html | 2 +- .../TestCase/Behavior/ClassMethods.html | 8 +- .../ActiveJob/Enqueuing/ClassMethods.html | 2 +- .../ActiveJob/Exceptions/ClassMethods.html | 4 +- src/7.2/classes/ActiveJob/Execution.html | 2 +- .../QueueAdapters/QueueClassicAdapter.html | 2 +- src/7.2/classes/ActiveJob/TestHelper.html | 4 +- src/7.2/classes/ActiveModel.html | 2 +- src/7.2/classes/ActiveModel/API.html | 4 +- .../classes/ActiveModel/AttributeMethods.html | 4 +- .../AttributeMethods/ClassMethods.html | 8 +- src/7.2/classes/ActiveModel/Callbacks.html | 10 +- src/7.2/classes/ActiveModel/Dirty.html | 8 +- .../classes/ActiveModel/EachValidator.html | 4 +- src/7.2/classes/ActiveModel/Errors.html | 10 +- src/7.2/classes/ActiveModel/Lint/Tests.html | 2 +- src/7.2/classes/ActiveModel/Model.html | 2 +- src/7.2/classes/ActiveModel/Name.html | 4 +- src/7.2/classes/ActiveModel/Naming.html | 2 +- .../SecurePassword/ClassMethods.html | 2 +- .../classes/ActiveModel/Serialization.html | 2 +- .../classes/ActiveModel/Serializers/JSON.html | 2 +- src/7.2/classes/ActiveModel/Translation.html | 4 +- src/7.2/classes/ActiveModel/Type/Boolean.html | 2 +- src/7.2/classes/ActiveModel/Type/Value.html | 2 +- src/7.2/classes/ActiveModel/Validations.html | 8 +- .../ActiveModel/Validations/Callbacks.html | 2 +- .../ActiveModel/Validations/ClassMethods.html | 6 +- .../Validations/HelperMethods.html | 2 +- src/7.2/classes/ActiveRecord.html | 2 +- .../Associations/ClassMethods.html | 226 +++++++++--------- .../Associations/CollectionProxy.html | 6 +- .../ActiveRecord/AttributeMethods.html | 2 +- .../ActiveRecord/AttributeMethods/Dirty.html | 8 +- .../Serialization/ClassMethods.html | 8 +- .../ActiveRecord/Attributes/ClassMethods.html | 2 +- .../ConnectionAdapters/AbstractAdapter.html | 2 +- .../AbstractMysqlAdapter.html | 6 +- .../ConnectionAdapters/ConnectionPool.html | 6 +- .../DatabaseStatements.html | 2 +- .../PostgreSQL/DatabaseStatements.html | 2 +- .../PostgreSQL/SchemaStatements.html | 14 +- .../ConnectionAdapters/PostgreSQLAdapter.html | 2 +- .../ConnectionAdapters/SchemaStatements.html | 64 ++--- .../ActiveRecord/ConnectionHandling.html | 16 +- src/7.2/classes/ActiveRecord/Core.html | 2 +- .../ActiveRecord/Core/ClassMethods.html | 4 +- .../ActiveRecord/DatabaseConfigurations.html | 6 +- .../DatabaseConfigurations/HashConfig.html | 10 +- .../DatabaseConfigurations/UrlConfig.html | 4 +- .../classes/ActiveRecord/DelegatedType.html | 8 +- .../ActiveRecord/Encryption/Cipher.html | 10 +- .../Encryption/Cipher/Aes256Gcm.html | 2 +- .../ActiveRecord/Encryption/Contexts.html | 2 +- .../Encryption/EncryptableRecord.html | 2 +- .../Encryption/EncryptedAttributeType.html | 4 +- .../ActiveRecord/Encryption/Encryptor.html | 8 +- .../classes/ActiveRecord/Encryption/Key.html | 2 +- .../ActiveRecord/Encryption/KeyGenerator.html | 6 +- .../ActiveRecord/Encryption/KeyProvider.html | 2 +- .../ActiveRecord/Encryption/Properties.html | 2 +- .../Encryption/ReadOnlyNullEncryptor.html | 2 +- src/7.2/classes/ActiveRecord/Inheritance.html | 2 +- .../Inheritance/ClassMethods.html | 6 +- src/7.2/classes/ActiveRecord/Integration.html | 4 +- .../Integration/ClassMethods.html | 2 +- .../ActiveRecord/IrreversibleMigration.html | 4 +- .../ActiveRecord/Locking/Optimistic.html | 4 +- .../Locking/Optimistic/ClassMethods.html | 2 +- .../ActiveRecord/Locking/Pessimistic.html | 8 +- src/7.2/classes/ActiveRecord/Migration.html | 6 +- .../Migration/CommandRecorder.html | 4 +- .../ActiveRecord/MigrationContext.html | 2 +- src/7.2/classes/ActiveRecord/ModelSchema.html | 6 +- .../NestedAttributes/ClassMethods.html | 8 +- src/7.2/classes/ActiveRecord/Persistence.html | 2 +- .../Persistence/ClassMethods.html | 2 +- src/7.2/classes/ActiveRecord/Promise.html | 4 +- src/7.2/classes/ActiveRecord/QueryLogs.html | 2 +- .../classes/ActiveRecord/QueryMethods.html | 6 +- .../ActiveRecord/QueryMethods/WhereChain.html | 2 +- src/7.2/classes/ActiveRecord/Querying.html | 4 +- .../Reflection/MacroReflection.html | 2 +- src/7.2/classes/ActiveRecord/Relation.html | 36 +-- .../Scoping/Default/ClassMethods.html | 2 +- .../SecurePassword/ClassMethods.html | 2 +- .../SecureToken/ClassMethods.html | 6 +- src/7.2/classes/ActiveRecord/SignedId.html | 4 +- .../ActiveRecord/SignedId/ClassMethods.html | 4 +- .../ActiveRecord/Tasks/DatabaseTasks.html | 10 +- src/7.2/classes/ActiveRecord/Timestamp.html | 2 +- .../Transactions/ClassMethods.html | 2 +- .../Validations/ClassMethods.html | 2 +- src/7.2/classes/ActiveStorage.html | 4 +- .../classes/ActiveStorage/Attached/Model.html | 14 +- src/7.2/classes/ActiveStorage/Attachment.html | 6 +- src/7.2/classes/ActiveStorage/Blob.html | 10 +- .../ActiveStorage/Blob/Analyzable.html | 2 +- src/7.2/classes/ActiveStorage/Preview.html | 4 +- src/7.2/classes/ActiveStorage/Service.html | 2 +- src/7.2/classes/ActiveStorage/Variation.html | 2 +- .../ActiveSupport/ActionableError.html | 2 +- .../classes/ActiveSupport/ArrayInquirer.html | 2 +- .../ActiveSupport/Cache/FileStore.html | 2 +- .../ActiveSupport/Cache/MemCacheStore.html | 8 +- .../ActiveSupport/Cache/MemoryStore.html | 4 +- .../ActiveSupport/Cache/RedisCacheStore.html | 4 +- .../classes/ActiveSupport/Cache/Store.html | 10 +- .../ActiveSupport/Cache/WriteOptions.html | 6 +- src/7.2/classes/ActiveSupport/Callbacks.html | 2 +- .../ActiveSupport/Callbacks/ClassMethods.html | 6 +- src/7.2/classes/ActiveSupport/Concern.html | 4 +- .../ActiveSupport/Concurrency/ShareLock.html | 2 +- .../ActiveSupport/CurrentAttributes.html | 2 +- .../Dependencies/RequireDependency.html | 2 +- .../ActiveSupport/Deprecation/Behavior.html | 28 +-- .../DeprecatedConstantAccessor.html | 2 +- .../ActiveSupport/DescendantsTracker.html | 2 +- src/7.2/classes/ActiveSupport/Duration.html | 2 +- .../ActiveSupport/EncryptedConfiguration.html | 2 +- .../classes/ActiveSupport/EncryptedFile.html | 6 +- .../classes/ActiveSupport/ErrorReporter.html | 2 +- .../ActiveSupport/ExecutionWrapper.html | 2 +- .../ActiveSupport/FileUpdateChecker.html | 6 +- .../HashWithIndifferentAccess.html | 8 +- .../ActiveSupport/InheritableOptions.html | 2 +- .../classes/ActiveSupport/LazyLoadHooks.html | 6 +- .../classes/ActiveSupport/LogSubscriber.html | 6 +- .../ActiveSupport/MessageEncryptor.html | 24 +- .../classes/ActiveSupport/MessagePack.html | 2 +- .../ActiveSupport/MessageVerifier.html | 34 +-- .../ActiveSupport/Multibyte/Chars.html | 2 +- .../classes/ActiveSupport/Notifications.html | 8 +- .../Notifications/Fanout/Handle.html | 4 +- .../Notifications/Instrumenter.html | 2 +- .../classes/ActiveSupport/NumberHelper.html | 98 ++++---- .../ActiveSupport/NumericWithFormat.html | 2 +- .../classes/ActiveSupport/OrderedOptions.html | 6 +- .../ActiveSupport/ParameterFilter.html | 6 +- .../ActiveSupport/RangeWithFormat.html | 2 +- .../ActiveSupport/Rescuable/ClassMethods.html | 4 +- .../classes/ActiveSupport/StringInquirer.html | 2 +- src/7.2/classes/ActiveSupport/Subscriber.html | 2 +- .../ActiveSupport/Testing/Deprecation.html | 2 +- .../Testing/ErrorReporterAssertions.html | 4 +- .../ActiveSupport/Testing/FileFixtures.html | 4 +- .../Testing/SetupAndTeardown.html | 2 +- .../ActiveSupport/Testing/TimeHelpers.html | 6 +- .../classes/ActiveSupport/TimeWithZone.html | 18 +- src/7.2/classes/ActiveSupport/TimeZone.html | 2 +- src/7.2/classes/Array.html | 14 +- src/7.2/classes/Class.html | 2 +- src/7.2/classes/Date.html | 8 +- src/7.2/classes/DateAndTime/Calculations.html | 26 +- src/7.2/classes/DateAndTime/Zones.html | 6 +- src/7.2/classes/DateTime.html | 10 +- src/7.2/classes/ERB/Util.html | 2 +- src/7.2/classes/Enumerable.html | 8 +- src/7.2/classes/Hash.html | 14 +- src/7.2/classes/Module.html | 12 +- src/7.2/classes/Object.html | 24 +- src/7.2/classes/Rails/Application.html | 12 +- .../Rails/Application/Configuration.html | 4 +- .../Configuration/MiddlewareStackProxy.html | 6 +- src/7.2/classes/Rails/Engine.html | 22 +- src/7.2/classes/Rails/Generators/Actions.html | 26 +- src/7.2/classes/Rails/Paths/Root.html | 2 +- src/7.2/classes/Rails/Railtie.html | 6 +- .../Rails/SourceAnnotationExtractor.html | 2 +- src/7.2/classes/String.html | 6 +- src/7.2/classes/Time.html | 22 +- src/7.2/files/activemodel/README_rdoc.html | 2 +- .../app/models/active_storage/preview_rb.html | 2 +- .../attribute_accessors_per_thread_rb.html | 2 +- src/7.2/files/railties/RDOC_MAIN_md.html | 4 +- src/7.2/index.html | 4 +- 260 files changed, 1013 insertions(+), 1013 deletions(-) diff --git a/src/7.2/classes/AbstractController/Base.html b/src/7.2/classes/AbstractController/Base.html index ac4743c336..c84f1938f7 100644 --- a/src/7.2/classes/AbstractController/Base.html +++ b/src/7.2/classes/AbstractController/Base.html @@ -300,7 +300,7 @@

    Returns

    @@ -415,7 +415,7 @@

    -

    Returns true if the given controller is capable of rendering a path. A subclass of AbstractController::Base may return false. An Email controller for example does not support paths, only full URLs.

    +

    Returns true if the given controller is capable of rendering a path. A subclass of AbstractController::Base may return false. An Email controller for example does not support paths, only full URLs.

    @@ -529,7 +529,7 @@

    Parameters

    • -

      action_name - The name of an action to be tested

      +

      action_name - The name of an action to be tested

    diff --git a/src/7.2/classes/AbstractController/Caching/Fragments.html b/src/7.2/classes/AbstractController/Caching/Fragments.html index c2c5129209..f3f332b86b 100644 --- a/src/7.2/classes/AbstractController/Caching/Fragments.html +++ b/src/7.2/classes/AbstractController/Caching/Fragments.html @@ -108,7 +108,7 @@

    -

    Given a key (as described in expire_fragment), returns a key array suitable for use in reading, writing, or expiring a cached fragment. All keys begin with :views, followed by ENV["RAILS_CACHE_ID"] or ENV["RAILS_APP_VERSION"] if set, followed by any controller-wide key prefix values, ending with the specified key value.

    +

    Given a key (as described in expire_fragment), returns a key array suitable for use in reading, writing, or expiring a cached fragment. All keys begin with :views, followed by ENV["RAILS_CACHE_ID"] or ENV["RAILS_APP_VERSION"] if set, followed by any controller-wide key prefix values, ending with the specified key value.

    @@ -204,7 +204,7 @@

    -

    Check if a cached fragment from the location signified by key exists (see expire_fragment for acceptable formats).

    +

    Check if a cached fragment from the location signified by key exists (see expire_fragment for acceptable formats).

    @@ -244,7 +244,7 @@

    -

    Reads a cached fragment from the location signified by key (see expire_fragment for acceptable formats).

    +

    Reads a cached fragment from the location signified by key (see expire_fragment for acceptable formats).

    @@ -285,7 +285,7 @@

    -

    Writes content to the location signified by key (see expire_fragment for acceptable formats).

    +

    Writes content to the location signified by key (see expire_fragment for acceptable formats).

    diff --git a/src/7.2/classes/AbstractController/Rendering.html b/src/7.2/classes/AbstractController/Rendering.html index a88e055017..ab573e1e7b 100644 --- a/src/7.2/classes/AbstractController/Rendering.html +++ b/src/7.2/classes/AbstractController/Rendering.html @@ -123,7 +123,7 @@

    Normalizes arguments and options, and then delegates to render_to_body and sticks the result in self.response_body.

    -

    Supported options depend on the underlying render_to_body implementation.

    +

    Supported options depend on the underlying render_to_body implementation.

    diff --git a/src/7.2/classes/ActionCable/Channel/Base.html b/src/7.2/classes/ActionCable/Channel/Base.html index f6d0fe65bd..9e9571f960 100644 --- a/src/7.2/classes/ActionCable/Channel/Base.html +++ b/src/7.2/classes/ActionCable/Channel/Base.html @@ -82,7 +82,7 @@

    Action process end

    -

    In this example, the subscribed and unsubscribed methods are not callable methods, as they were already declared in ActionCable::Channel::Base, but #appear and #away are. #generate_connection_token is also not callable, since it’s a private method. You’ll see that appear accepts a data parameter, which it then uses as part of its model call. #away does not, since it’s simply a trigger action.

    +

    In this example, the subscribed and unsubscribed methods are not callable methods, as they were already declared in ActionCable::Channel::Base, but appear and away are. generate_connection_token is also not callable, since it’s a private method. You’ll see that appear accepts a data parameter, which it then uses as part of its model call. away does not, since it’s simply a trigger action.

    Also note that in this example, current_user is available because it was marked as an identifying attribute on the connection. All such identifiers will automatically create a delegation method of the same name on the channel instance.

    diff --git a/src/7.2/classes/ActionCable/Channel/ChannelStub.html b/src/7.2/classes/ActionCable/Channel/ChannelStub.html index 816f6c96a6..0a17417ed5 100644 --- a/src/7.2/classes/ActionCable/Channel/ChannelStub.html +++ b/src/7.2/classes/ActionCable/Channel/ChannelStub.html @@ -25,7 +25,7 @@

    Action Cable Channel Stub

    -

    Stub stream_from to track streams for the channel. Add public aliases for subscription_confirmation_sent? and subscription_rejected?.

    +

    Stub stream_from to track streams for the channel. Add public aliases for subscription_confirmation_sent? and subscription_rejected?.

    diff --git a/src/7.2/classes/ActionCable/Channel/Naming/ClassMethods.html b/src/7.2/classes/ActionCable/Channel/Naming/ClassMethods.html index 0c44c137f1..56846c3ad7 100644 --- a/src/7.2/classes/ActionCable/Channel/Naming/ClassMethods.html +++ b/src/7.2/classes/ActionCable/Channel/Naming/ClassMethods.html @@ -66,7 +66,7 @@

    -

    Returns the name of the channel, underscored, without the Channel ending. If the channel is in a namespace, then the namespaces are represented by single colon separators in the channel name.

    +

    Returns the name of the channel, underscored, without the Channel ending. If the channel is in a namespace, then the namespaces are represented by single colon separators in the channel name.

    ChatChannel.channel_name # => 'chat'
     Chats::AppearancesChannel.channel_name # => 'chats:appearances'
    diff --git a/src/7.2/classes/ActionCable/Channel/TestCase.html b/src/7.2/classes/ActionCable/Channel/TestCase.html
    index 9d39fb0a27..b4cc602a7a 100644
    --- a/src/7.2/classes/ActionCable/Channel/TestCase.html
    +++ b/src/7.2/classes/ActionCable/Channel/TestCase.html
    @@ -80,13 +80,13 @@ 

    Basic example<

    Special methods

    ActionCable::Channel::TestCase will also automatically provide the following instance methods for use in the tests:

    -
    connection +
    connection

    An ActionCable::Channel::ConnectionStub, representing the current HTTP connection.

    -
    subscription +
    subscription

    An instance of the current channel, created when you call subscribe.

    -
    transmissions +
    transmissions

    A list of all messages that have been transmitted into the channel.

    diff --git a/src/7.2/classes/ActionCable/RemoteConnections/RemoteConnection.html b/src/7.2/classes/ActionCable/RemoteConnections/RemoteConnection.html index 310d2ded36..3bc225b800 100644 --- a/src/7.2/classes/ActionCable/RemoteConnections/RemoteConnection.html +++ b/src/7.2/classes/ActionCable/RemoteConnections/RemoteConnection.html @@ -31,7 +31,7 @@

    Action Cable Remote Connection

    -

    Represents a single remote connection found via ActionCable.server.remote_connections.where(*). Exists solely for the purpose of calling disconnect on that connection.

    +

    Represents a single remote connection found via ActionCable.server.remote_connections.where(*). Exists solely for the purpose of calling disconnect on that connection.

    diff --git a/src/7.2/classes/ActionCable/SubscriptionAdapter/Test.html b/src/7.2/classes/ActionCable/SubscriptionAdapter/Test.html index da74033de1..2bbe797904 100644 --- a/src/7.2/classes/ActionCable/SubscriptionAdapter/Test.html +++ b/src/7.2/classes/ActionCable/SubscriptionAdapter/Test.html @@ -35,7 +35,7 @@

    Test adapter extends the ActionCable::SubscriptionAdapter::Async adapter, so it could be used in system tests too.

    diff --git a/src/7.2/classes/ActionController/API.html b/src/7.2/classes/ActionController/API.html index 9c272663fb..69d62aa999 100644 --- a/src/7.2/classes/ActionController/API.html +++ b/src/7.2/classes/ActionController/API.html @@ -35,7 +35,7 @@

    Action Controll

    An API Controller is different from a normal controller in the sense that by default it doesn’t include a number of features that are usually required by browser access only: layouts and templates rendering, flash, assets, and so on. This makes the entire controller stack thinner, suitable for API applications. It doesn’t mean you won’t have such features if you need them: they’re all available for you to include in your application, they’re just not part of the default API controller stack.

    -

    Normally, ApplicationController is the only controller that inherits from ActionController::API. All other controllers in turn inherit from ApplicationController.

    +

    Normally, ApplicationController is the only controller that inherits from ActionController::API. All other controllers in turn inherit from ApplicationController.

    A sample controller could look like this:

    @@ -71,7 +71,7 @@

    Redirects

    Adding New Behavior

    -

    In some scenarios you may want to add back some functionality provided by ActionController::Base that is not present by default in ActionController::API, for instance MimeResponds. This module gives you the respond_to method. Adding it is quite simple, you just need to include the module in a specific controller or in ApplicationController in case you want it available in your entire application:

    +

    In some scenarios you may want to add back some functionality provided by ActionController::Base that is not present by default in ActionController::API, for instance MimeResponds. This module gives you the respond_to method. Adding it is quite simple, you just need to include the module in a specific controller or in ApplicationController in case you want it available in your entire application:

    class ApplicationController < ActionController::API
       include ActionController::MimeResponds
    @@ -89,7 +89,7 @@ 

    Adding New Behavi end

    -

    Make sure to check the modules included in ActionController::Base if you want to use any other functionality that is not provided by ActionController::API out of the box.

    +

    Make sure to check the modules included in ActionController::Base if you want to use any other functionality that is not provided by ActionController::API out of the box.

    diff --git a/src/7.2/classes/ActionController/AllowBrowser/ClassMethods.html b/src/7.2/classes/ActionController/AllowBrowser/ClassMethods.html index fac5a861f2..bb56bb0bcb 100644 --- a/src/7.2/classes/ActionController/AllowBrowser/ClassMethods.html +++ b/src/7.2/classes/ActionController/AllowBrowser/ClassMethods.html @@ -74,7 +74,7 @@

    You can use caniuse.com to check for browser versions supporting the features you use.

    -

    You can use ActiveSupport::Notifications to subscribe to events of browsers being blocked using the browser_block.action_controller event name.

    +

    You can use ActiveSupport::Notifications to subscribe to events of browsers being blocked using the browser_block.action_controller event name.

    Examples:

    diff --git a/src/7.2/classes/ActionController/Base.html b/src/7.2/classes/ActionController/Base.html index 39dc42ce05..47733a4b17 100644 --- a/src/7.2/classes/ActionController/Base.html +++ b/src/7.2/classes/ActionController/Base.html @@ -33,7 +33,7 @@

    Action Contro

    Action Controllers are the core of a web request in Rails. They are made up of one or more actions that are executed on request and then either it renders a template or redirects to another action. An action is defined as a public method on the controller, which will automatically be made accessible to the web-server through Rails Routes.

    -

    By default, only the ApplicationController in a Rails application inherits from ActionController::Base. All other controllers inherit from ApplicationController. This gives you one class to configure things such as request forgery protection and filtering of sensitive request parameters.

    +

    By default, only the ApplicationController in a Rails application inherits from ActionController::Base. All other controllers inherit from ApplicationController. This gives you one class to configure things such as request forgery protection and filtering of sensitive request parameters.

    A sample controller could look like this:

    diff --git a/src/7.2/classes/ActionController/ConditionalGet.html b/src/7.2/classes/ActionController/ConditionalGet.html index 0597240c1d..8f4c523090 100644 --- a/src/7.2/classes/ActionController/ConditionalGet.html +++ b/src/7.2/classes/ActionController/ConditionalGet.html @@ -113,21 +113,21 @@

    -

    Sets the Cache-Control header, overwriting existing directives. This method will also ensure an HTTP Date header for client compatibility.

    +

    Sets the Cache-Control header, overwriting existing directives. This method will also ensure an HTTP Date header for client compatibility.

    Defaults to issuing the private directive, so that intermediate caches must not cache the response.

    Options

    -
    :public +
    :public

    If true, replaces the default private directive with the public directive.

    -
    :must_revalidate +
    :must_revalidate

    If true, adds the must-revalidate directive.

    -
    :stale_while_revalidate +
    :stale_while_revalidate

    Sets the value of the stale-while-revalidate directive.

    -
    :stale_if_error +
    :stale_if_error

    Sets the value of the stale-if-error directive.

    @@ -237,29 +237,29 @@

    Sets the etag, last_modified, or both on the response, and renders a 304 Not Modified response if the request is already fresh.

    Options

    -
    :etag +
    :etag

    Sets a “weak” ETag validator on the response. See the :weak_etag option.

    -
    :weak_etag +
    :weak_etag

    Sets a “weak” ETag validator on the response. Requests that specify an If-None-Match header may receive a 304 Not Modified response if the ETag matches exactly.

    -

    A weak ETag indicates semantic equivalence, not byte-for-byte equality, so they’re good for caching HTML pages in browser caches. They can’t be used for responses that must be byte-identical, like serving Range requests within a PDF file.

    -
    :strong_etag +

    A weak ETag indicates semantic equivalence, not byte-for-byte equality, so they’re good for caching HTML pages in browser caches. They can’t be used for responses that must be byte-identical, like serving Range requests within a PDF file.

    +
    :strong_etag

    Sets a “strong” ETag validator on the response. Requests that specify an If-None-Match header may receive a 304 Not Modified response if the ETag matches exactly.

    -

    A strong ETag implies exact equality – the response must match byte for byte. This is necessary for serving Range requests within a large video or PDF file, for example, or for compatibility with some CDNs that don’t support weak ETags.

    -
    :last_modified +

    A strong ETag implies exact equality – the response must match byte for byte. This is necessary for serving Range requests within a large video or PDF file, for example, or for compatibility with some CDNs that don’t support weak ETags.

    +
    :last_modified

    Sets a “weak” last-update validator on the response. Subsequent requests that specify an If-Modified-Since header may receive a 304 Not Modified response if last_modified <= If-Modified-Since.

    -
    :public +
    :public

    By default the Cache-Control header is private. Set this option to true if you want your application to be cacheable by other devices, such as proxy caches.

    -
    :cache_control +
    :cache_control

    When given, will overwrite an existing Cache-Control header. For a list of Cache-Control directives, see the article on MDN.

    -
    :template +
    :template

    By default, the template digest for the current controller/action is included in ETags. If the action renders a different template, you can include its digest instead. If the action doesn’t render a template at all, you can pass template: false to skip any attempt to check for a template digest.

    diff --git a/src/7.2/classes/ActionController/DataStreaming.html b/src/7.2/classes/ActionController/DataStreaming.html index 80007516f7..d24cc215e1 100644 --- a/src/7.2/classes/ActionController/DataStreaming.html +++ b/src/7.2/classes/ActionController/DataStreaming.html @@ -94,7 +94,7 @@

    Sends the given binary data to the browser. This method is similar to render plain: data, but also allows you to specify whether the browser should display the response as a file attachment (i.e. in a download dialog) or as inline data. You may also set the content type, the file name, and other things.

    -

    Options: * :filename - suggests a filename for the browser to use. * :type - specifies an HTTP content type. Defaults to application/octet-stream. You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. If omitted, type will be inferred from the file extension specified in :filename. If no content type is registered for the extension, the default type application/octet-stream will be used. * :disposition - specifies whether the file will be shown inline or downloaded. Valid values are "inline" and "attachment" (default). * :status - specifies the status code to send with the response. Defaults to 200.

    +

    Options: * :filename - suggests a filename for the browser to use. * :type - specifies an HTTP content type. Defaults to application/octet-stream. You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. If omitted, type will be inferred from the file extension specified in :filename. If no content type is registered for the extension, the default type application/octet-stream will be used. * :disposition - specifies whether the file will be shown inline or downloaded. Valid values are "inline" and "attachment" (default). * :status - specifies the status code to send with the response. Defaults to 200.

    Generic data download:

    @@ -111,7 +111,7 @@

    send_data image.data, type: image.content_type, disposition: 'inline'
     
    -

    See send_file for more information on HTTP Content-* headers and caching.

    +

    See send_file for more information on HTTP Content-* headers and caching.

    @@ -151,7 +151,7 @@

    Be careful to sanitize the path parameter if it is coming from a web page. send_file(params[:path]) allows a malicious user to download any file on your server.

    -

    Options: * :filename - suggests a filename for the browser to use. Defaults to File.basename(path). * :type - specifies an HTTP content type. You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. If omitted, the type will be inferred from the file extension specified in :filename. If no content type is registered for the extension, the default type application/octet-stream will be used. * :disposition - specifies whether the file will be shown inline or downloaded. Valid values are "inline" and "attachment" (default). * :status - specifies the status code to send with the response. Defaults to 200. * :url_based_filename - set to true if you want the browser to guess the filename from the URL, which is necessary for i18n filenames on certain browsers (setting :filename overrides this option).

    +

    Options: * :filename - suggests a filename for the browser to use. Defaults to File.basename(path). * :type - specifies an HTTP content type. You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. If omitted, the type will be inferred from the file extension specified in :filename. If no content type is registered for the extension, the default type application/octet-stream will be used. * :disposition - specifies whether the file will be shown inline or downloaded. Valid values are "inline" and "attachment" (default). * :status - specifies the status code to send with the response. Defaults to 200. * :url_based_filename - set to true if you want the browser to guess the filename from the URL, which is necessary for i18n filenames on certain browsers (setting :filename overrides this option).

    The default Content-Type and Content-Disposition headers are set to download arbitrary binary files in as many browsers as possible. IE versions 4, 5, 5.5, and 6 are all known to have a variety of quirks (especially when downloading over SSL).

    diff --git a/src/7.2/classes/ActionController/Helpers.html b/src/7.2/classes/ActionController/Helpers.html index dc62f38ac9..aa57055eed 100644 --- a/src/7.2/classes/ActionController/Helpers.html +++ b/src/7.2/classes/ActionController/Helpers.html @@ -27,7 +27,7 @@

    Action

    The Rails framework provides a large number of helpers for working with assets, dates, forms, numbers and model objects, to name a few. These helpers are available to all templates by default.

    -

    In addition to using the standard template helpers provided, creating custom helpers to extract complicated logic or reusable functionality is strongly encouraged. By default, each controller will include all helpers. These helpers are only accessible on the controller through #helpers

    +

    In addition to using the standard template helpers provided, creating custom helpers to extract complicated logic or reusable functionality is strongly encouraged. By default, each controller will include all helpers. These helpers are only accessible on the controller through helpers

    In previous versions of Rails the controller will include a helper which matches the name of the controller, e.g., MyController will automatically include MyHelper. You can revert to the old behavior with the following:

    diff --git a/src/7.2/classes/ActionController/HttpAuthentication/Token.html b/src/7.2/classes/ActionController/HttpAuthentication/Token.html index e734b080f9..f9b5dc98d8 100644 --- a/src/7.2/classes/ActionController/HttpAuthentication/Token.html +++ b/src/7.2/classes/ActionController/HttpAuthentication/Token.html @@ -354,7 +354,7 @@

    -

    Takes raw_params and turns it into an array of parameters.

    +

    Takes raw_params and turns it into an array of parameters.

    @@ -389,7 +389,7 @@

    -

    This method takes an authorization body and splits up the key-value pairs by the standardized :, ;, or \t delimiters defined in AUTHN_PAIR_DELIMITERS.

    +

    This method takes an authorization body and splits up the key-value pairs by the standardized :, ;, or \t delimiters defined in AUTHN_PAIR_DELIMITERS.

    @@ -473,7 +473,7 @@

    Then the returned token is "abc", and the options are {nonce: "def"}.

    -

    Returns an Array of [String, Hash] if a token is present. Returns nil if no token is found.

    +

    Returns an Array of [String, Hash] if a token is present. Returns nil if no token is found.

    Parameters

    • diff --git a/src/7.2/classes/ActionController/Live.html b/src/7.2/classes/ActionController/Live.html index dfacaa6678..1e73b6f337 100644 --- a/src/7.2/classes/ActionController/Live.html +++ b/src/7.2/classes/ActionController/Live.html @@ -253,7 +253,7 @@

      Sends a stream to the browser, which is helpful when you’re generating exports or other running data where you don’t want the entire file buffered in memory first. Similar to send_data, but where the data is generated live.

      -

      Options: * :filename - suggests a filename for the browser to use. * :type - specifies an HTTP content type. You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. If omitted, type will be inferred from the file extension specified in :filename. If no content type is registered for the extension, the default type ‘application/octet-stream’ will be used. * :disposition - specifies whether the file will be shown inline or downloaded. Valid values are ‘inline’ and ‘attachment’ (default).

      +

      Options: * :filename - suggests a filename for the browser to use. * :type - specifies an HTTP content type. You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. If omitted, type will be inferred from the file extension specified in :filename. If no content type is registered for the extension, the default type ‘application/octet-stream’ will be used. * :disposition - specifies whether the file will be shown inline or downloaded. Valid values are ‘inline’ and ‘attachment’ (default).

      Example of generating a csv export:

      diff --git a/src/7.2/classes/ActionController/Live/SSE.html b/src/7.2/classes/ActionController/Live/SSE.html index 61dc811a51..9d025392c4 100644 --- a/src/7.2/classes/ActionController/Live/SSE.html +++ b/src/7.2/classes/ActionController/Live/SSE.html @@ -34,13 +34,13 @@

      SSE (Server Sent Event) to an IO stream. The class is initialized with a stream and can be used to either write a JSON string or an object which can be converted to JSON.

      Writing an object will convert it into standard SSE format with whatever options you have configured. You may choose to set the following options:

      -
      :event +
      :event

      If specified, an event with this name will be dispatched on the browser.

      -
      :retry +
      :retry

      The reconnection time in milliseconds used when attempting to send the event.

      -
      :id +
      :id

      If the connection dies while sending an SSE to the browser, then the server will receive a Last-Event-ID header with value equal to id.

      diff --git a/src/7.2/classes/ActionController/Metal.html b/src/7.2/classes/ActionController/Metal.html index 26d9f8c89e..029b2e5a92 100644 --- a/src/7.2/classes/ActionController/Metal.html +++ b/src/7.2/classes/ActionController/Metal.html @@ -33,7 +33,7 @@

      Action Controller Metal

      -

      ActionController::Metal is the simplest possible controller, providing a valid Rack interface without the additional niceties provided by ActionController::Base.

      +

      ActionController::Metal is the simplest possible controller, providing a valid Rack interface without the additional niceties provided by ActionController::Base.

      A sample metal controller might look like this:

      @@ -53,7 +53,7 @@

      Action Cont

      Rendering Helpers

      -

      By default, ActionController::Metal provides no utilities for rendering views, partials, or other responses aside from some low-level setters such as response_body=, content_type=, and status=. To add the render helpers you’re used to having in a normal controller, you can do the following:

      +

      By default, ActionController::Metal provides no utilities for rendering views, partials, or other responses aside from some low-level setters such as response_body=, content_type=, and status=. To add the render helpers you’re used to having in a normal controller, you can do the following:

      class HelloController < ActionController::Metal
         include AbstractController::Rendering
      @@ -1088,7 +1088,7 @@ 

      -

      Basic url_for that can be overridden for more robust functionality.

      +

      Basic url_for that can be overridden for more robust functionality.

      diff --git a/src/7.2/classes/ActionController/MimeResponds.html b/src/7.2/classes/ActionController/MimeResponds.html index 3509f3fc6b..bdda3f311d 100644 --- a/src/7.2/classes/ActionController/MimeResponds.html +++ b/src/7.2/classes/ActionController/MimeResponds.html @@ -177,7 +177,7 @@

      Mime::Type.register "image/jpeg", :jpg
       
      -

      respond_to also allows you to specify a common block for different formats by using any:

      +

      respond_to also allows you to specify a common block for different formats by using any:

      def index
         @people = Person.all
      diff --git a/src/7.2/classes/ActionController/Parameters.html b/src/7.2/classes/ActionController/Parameters.html
      index 59f661c20b..75220b12a0 100644
      --- a/src/7.2/classes/ActionController/Parameters.html
      +++ b/src/7.2/classes/ActionController/Parameters.html
      @@ -57,7 +57,7 @@ 

      A @@ -86,7 +86,7 @@

      A

      Please note that these options are not thread-safe. In a multi-threaded environment they should only be set once at boot-time and never mutated at runtime.

      -

      You can fetch values of ActionController::Parameters using either :key or "key".

      +

      You can fetch values of ActionController::Parameters using either :key or "key".

      params = ActionController::Parameters.new(key: "value")
       params[:key]  # => "value"
      @@ -567,7 +567,7 @@ 

      -

      Returns a new ActionController::Parameters instance. Also, sets the permitted attribute to the default value of ActionController::Parameters.permit_all_parameters.

      +

      Returns a new ActionController::Parameters instance. Also, sets the permitted attribute to the default value of ActionController::Parameters.permit_all_parameters.

      class Person < ActiveRecord::Base
       end
      @@ -628,7 +628,7 @@ 

      -

      Returns true if another Parameters object contains the same content and permitted flag.

      +

      Returns true if another Parameters object contains the same content and permitted flag.

      @@ -766,7 +766,7 @@

      -

      Returns a new ActionController::Parameters instance with nil values removed.

      +

      Returns a new ActionController::Parameters instance with nil values removed.

      @@ -836,7 +836,7 @@

      -

      Returns a new ActionController::Parameters instance without the blank values. Uses Object#blank? for determining if a value is blank.

      +

      Returns a new ActionController::Parameters instance without the blank values. Uses Object#blank? for determining if a value is blank.

      @@ -943,7 +943,7 @@

      -

      Returns a duplicate ActionController::Parameters instance with the same permitted parameters.

      +

      Returns a duplicate ActionController::Parameters instance with the same permitted parameters.

      @@ -981,7 +981,7 @@

      -

      Returns a new ActionController::Parameters instance with self and other_hash merged recursively.

      +

      Returns a new ActionController::Parameters instance with self and other_hash merged recursively.

      Like with Hash#merge in the standard library, a block can be provided to merge values.

      @@ -1007,7 +1007,7 @@

      -

      Same as #deep_merge, but modifies self.

      +

      Same as deep_merge, but modifies self.

      @@ -1030,7 +1030,7 @@

      -

      Returns a new ActionController::Parameters instance with the results of running block once for every key. This includes the keys from the root hash and from all nested hashes and arrays. The values are unchanged.

      +

      Returns a new ActionController::Parameters instance with the results of running block once for every key. This includes the keys from the root hash and from all nested hashes and arrays. The values are unchanged.

      @@ -1067,7 +1067,7 @@

      -

      Returns the same ActionController::Parameters instance with changed keys. This includes the keys from the root hash and from all nested hashes and arrays. The values are unchanged.

      +

      Returns the same ActionController::Parameters instance with changed keys. This includes the keys from the root hash and from all nested hashes and arrays. The values are unchanged.

      @@ -1103,7 +1103,7 @@

      -

      Deletes a key-value pair from Parameters and returns the value. If key is not found, returns nil (or, with optional code block, yields key and returns the result). This method is similar to extract!, which returns the corresponding ActionController::Parameters object.

      +

      Deletes a key-value pair from Parameters and returns the value. If key is not found, returns nil (or, with optional code block, yields key and returns the result). This method is similar to extract!, which returns the corresponding ActionController::Parameters object.

      @@ -1401,7 +1401,7 @@

      -

      Returns a new ActionController::Parameters instance that filters out the given keys.

      +

      Returns a new ActionController::Parameters instance that filters out the given keys.

      params = ActionController::Parameters.new(a: 1, b: 2, c: 3)
       params.except(:a, :b) # => #<ActionController::Parameters {"c"=>3} permitted: false>
      @@ -1556,7 +1556,7 @@ 

      -

      Returns a parameter for the given key. If the key can’t be found, there are several options: With no other arguments, it will raise an ActionController::ParameterMissing error; if a second argument is given, then that is returned (converted to an instance of ActionController::Parameters if possible); if a block is given, then that will be run and its result returned.

      +

      Returns a parameter for the given key. If the key can’t be found, there are several options: With no other arguments, it will raise an ActionController::ParameterMissing error; if a second argument is given, then that is returned (converted to an instance of ActionController::Parameters if possible); if a block is given, then that will be run and its result returned.

      params = ActionController::Parameters.new(person: { name: "Francesco" })
       params.fetch(:person)               # => #<ActionController::Parameters {"name"=>"Francesco"} permitted: false>
      @@ -1867,7 +1867,7 @@ 

      -

      Returns a new ActionController::Parameters instance with all keys from other_hash merged into current hash.

      +

      Returns a new ActionController::Parameters instance with all keys from other_hash merged into current hash.

      @@ -1905,7 +1905,7 @@

      -

      Returns the current ActionController::Parameters instance with other_hash merged into current hash.

      +

      Returns the current ActionController::Parameters instance with other_hash merged into current hash.

      @@ -1941,7 +1941,7 @@

      -

      Returns a new ActionController::Parameters instance that includes only the given filters and sets the permitted attribute for the object to true. This is useful for limiting which attributes should be allowed for mass updating.

      +

      Returns a new ActionController::Parameters instance that includes only the given filters and sets the permitted attribute for the object to true. This is useful for limiting which attributes should be allowed for mass updating.

      params = ActionController::Parameters.new(user: { name: "Francesco", age: 22, role: "admin" })
       permitted = params.require(:user).permit(:name, :age)
      @@ -1956,7 +1956,7 @@ 

      params.permit(:name)
       
      -

      :name passes if it is a key of params whose associated value is of type String, Symbol, NilClass, Numeric, TrueClass, FalseClass, Date, Time, DateTime, StringIO, IO, ActionDispatch::Http::UploadedFile or Rack::Test::UploadedFile. Otherwise, the key :name is filtered out.

      +

      :name passes if it is a key of params whose associated value is of type String, Symbol, NilClass, Numeric, TrueClass, FalseClass, Date, Time, DateTime, StringIO, IO, ActionDispatch::Http::UploadedFile or Rack::Test::UploadedFile. Otherwise, the key :name is filtered out.

      You may declare that the parameter should be an array of permitted scalars by mapping it to an empty array:

      @@ -2189,7 +2189,7 @@

      -

      Returns a new ActionController::Parameters instance with items that the block evaluates to true removed.

      +

      Returns a new ActionController::Parameters instance with items that the block evaluates to true removed.

      @@ -2386,7 +2386,7 @@

      -

      Returns a new ActionController::Parameters instance with all keys from current hash merged into other_hash.

      +

      Returns a new ActionController::Parameters instance with all keys from current hash merged into other_hash.

      @@ -2427,7 +2427,7 @@

      -

      Returns the current ActionController::Parameters instance with current hash merged into other_hash.

      +

      Returns the current ActionController::Parameters instance with current hash merged into other_hash.

      @@ -2467,7 +2467,7 @@

      -

      Returns a new ActionController::Parameters instance with only items that the block evaluates to true.

      +

      Returns a new ActionController::Parameters instance with only items that the block evaluates to true.

      @@ -2542,7 +2542,7 @@

      -

      Returns a new ActionController::Parameters instance that includes only the given keys. If the given keys don’t exist, returns an empty hash.

      +

      Returns a new ActionController::Parameters instance that includes only the given keys. If the given keys don’t exist, returns an empty hash.

      params = ActionController::Parameters.new(a: 1, b: 2, c: 3)
       params.slice(:a, :b) # => #<ActionController::Parameters {"a"=>1, "b"=>2} permitted: false>
      @@ -2582,7 +2582,7 @@ 

      -

      Returns the current ActionController::Parameters instance which contains only the given keys.

      +

      Returns the current ActionController::Parameters instance which contains only the given keys.

      @@ -2668,7 +2668,7 @@

      -

      Returns a safe Hash representation of the parameters with all unpermitted keys removed.

      +

      Returns a safe Hash representation of the parameters with all unpermitted keys removed.

      params = ActionController::Parameters.new({
         name: "Senjougahara Hitagi",
      @@ -2911,7 +2911,7 @@ 

      -

      Returns a new ActionController::Parameters instance with the results of running block once for every key. The values are unchanged.

      +

      Returns a new ActionController::Parameters instance with the results of running block once for every key. The values are unchanged.

      @@ -2949,7 +2949,7 @@

      -

      Performs keys transformation and returns the altered ActionController::Parameters instance.

      +

      Performs keys transformation and returns the altered ActionController::Parameters instance.

      @@ -2986,7 +2986,7 @@

      -

      Returns a new ActionController::Parameters instance with the results of running block once for every value. The keys are unchanged.

      +

      Returns a new ActionController::Parameters instance with the results of running block once for every value. The keys are unchanged.

      params = ActionController::Parameters.new(a: 1, b: 2, c: 3)
       params.transform_values { |x| x * 2 }
      @@ -3029,7 +3029,7 @@ 

      -

      Performs values transformation and returns the altered ActionController::Parameters instance.

      +

      Performs values transformation and returns the altered ActionController::Parameters instance.

      @@ -3126,7 +3126,7 @@

      -

      Returns values that were assigned to the given keys. Note that all the Hash objects will be converted to ActionController::Parameters.

      +

      Returns values that were assigned to the given keys. Note that all the Hash objects will be converted to ActionController::Parameters.

      diff --git a/src/7.2/classes/ActionController/ParamsWrapper.html b/src/7.2/classes/ActionController/ParamsWrapper.html index 50c252db72..ef86b32143 100644 --- a/src/7.2/classes/ActionController/ParamsWrapper.html +++ b/src/7.2/classes/ActionController/ParamsWrapper.html @@ -41,7 +41,7 @@

      ParamsWrapper for :json format, instead of having to send JSON parameters like this:

      {"user": {"name": "Konata"}}
       
      @@ -65,7 +65,7 @@

      ActiveModel object (such as User.new(params[:user])), you might consider passing the model class to the method instead. The ParamsWrapper will actually try to determine the list of attribute names from the model and only wrap those attributes:

      class UsersController < ApplicationController
         wrap_parameters Person
      @@ -74,7 +74,7 @@ 

      ParamsWrapper will actually try to determine if there’s a model related to it or not. This controller, for example:

      class Admin::UsersController < ApplicationController
       end
      diff --git a/src/7.2/classes/ActionController/ParamsWrapper/Options/ClassMethods.html b/src/7.2/classes/ActionController/ParamsWrapper/Options/ClassMethods.html
      index 41fa4d29bc..50694c59b7 100644
      --- a/src/7.2/classes/ActionController/ParamsWrapper/Options/ClassMethods.html
      +++ b/src/7.2/classes/ActionController/ParamsWrapper/Options/ClassMethods.html
      @@ -149,7 +149,7 @@ 

      -

      Sets the name of the wrapper key, or the model which ParamsWrapper would use to determine the attribute names from.

      +

      Sets the name of the wrapper key, or the model which ParamsWrapper would use to determine the attribute names from.

      Examples

      diff --git a/src/7.2/classes/ActionController/RateLimiting/ClassMethods.html b/src/7.2/classes/ActionController/RateLimiting/ClassMethods.html index 905b345fd2..75399f3597 100644 --- a/src/7.2/classes/ActionController/RateLimiting/ClassMethods.html +++ b/src/7.2/classes/ActionController/RateLimiting/ClassMethods.html @@ -74,7 +74,7 @@

      Requests that exceed the rate limit are refused with a 429 Too Many Requests response. You can specialize this by passing a callable in the with: parameter. It’s evaluated within the context of the controller processing the request.

      -

      Rate limiting relies on a backing ActiveSupport::Cache store and defaults to config.action_controller.cache_store, which itself defaults to the global config.cache_store. If you don’t want to store rate limits in the same datastore as your general caches, you can pass a custom store in the store parameter.

      +

      Rate limiting relies on a backing ActiveSupport::Cache store and defaults to config.action_controller.cache_store, which itself defaults to the global config.cache_store. If you don’t want to store rate limits in the same datastore as your general caches, you can pass a custom store in the store parameter.

      Examples:

      diff --git a/src/7.2/classes/ActionController/Redirecting.html b/src/7.2/classes/ActionController/Redirecting.html index 5e0726f754..270a6445b8 100644 --- a/src/7.2/classes/ActionController/Redirecting.html +++ b/src/7.2/classes/ActionController/Redirecting.html @@ -214,15 +214,15 @@

      Redirects the browser to the target specified in options. This parameter can be any one of:

      • -

        Hash - The URL will be generated by calling url_for with the options.

        +

        Hash - The URL will be generated by calling url_for with the options.

      • Record - The URL will be generated by calling url_for with the options, which will reference a named URL for that record.

      • -

        String starting with protocol:// (like http://) or a protocol relative reference (like //) - Is passed straight through as the target for redirection.

        +

        String starting with protocol:// (like http://) or a protocol relative reference (like //) - Is passed straight through as the target for redirection.

      • -

        String not containing a protocol - The current protocol and host is prepended to the string.

        +

        String not containing a protocol - The current protocol and host is prepended to the string.

      • -

        Proc - A block that will be executed in the controller’s context. Should return any option accepted by redirect_to.

        +

        Proc - A block that will be executed in the controller’s context. Should return any option accepted by redirect_to.

      Examples

      @@ -259,7 +259,7 @@

      Examples

      redirect_to({ action: 'atom' }, alert: "Something serious happened")

      -

      Statements after redirect_to in our controller get executed, so redirect_to doesn’t stop the execution of the function. To terminate the execution of the function immediately after the redirect_to, use return.

      +

      Statements after redirect_to in our controller get executed, so redirect_to doesn’t stop the execution of the function. To terminate the execution of the function immediately after the redirect_to, use return.

      redirect_to post_url(@post) and return
       
      @@ -345,7 +345,7 @@

      url_from("https://dev.example.com/profile") # => nil

      -

      NOTE: there’s a similarity with url_for, which generates an internal URL from various options from within the app, e.g. url_for(@post). However, url_from is meant to take an external parameter to verify as in url_from(params[:redirect_url]).

      +

      NOTE: there’s a similarity with url_for, which generates an internal URL from various options from within the app, e.g. post) at url_for(. However, url_from is meant to take an external parameter to verify as in url_from(params[:redirect_url]).

      diff --git a/src/7.2/classes/ActionController/Renderer.html b/src/7.2/classes/ActionController/Renderer.html index 65c9f06f64..7b434a468f 100644 --- a/src/7.2/classes/ActionController/Renderer.html +++ b/src/7.2/classes/ActionController/Renderer.html @@ -227,7 +227,7 @@

      Parameter

      defaults - Default values for the Rack env. Entries are specified in the same format as env. env will be merged on top of these values. defaults will be retained when calling new on a renderer instance.

    -

    If no http_host is specified, the env HTTP host will be derived from the routes’ default_url_options. In this case, the https boolean and the script_name will also be derived from default_url_options if they were not specified. Additionally, the https boolean will fall back to Rails.application.config.force_ssl if default_url_options does not specify a protocol.

    +

    If no http_host is specified, the env HTTP host will be derived from the routes’ default_url_options. In this case, the https boolean and the script_name will also be derived from default_url_options if they were not specified. Additionally, the https boolean will fall back to Rails.application.config.force_ssl if default_url_options does not specify a protocol.

    diff --git a/src/7.2/classes/ActionController/Renderers.html b/src/7.2/classes/ActionController/Renderers.html index 351a4a96d9..c0951ca0f1 100644 --- a/src/7.2/classes/ActionController/Renderers.html +++ b/src/7.2/classes/ActionController/Renderers.html @@ -161,7 +161,7 @@

    end

    -

    Note that we used Mime for the csv mime type as it comes with Rails. For a custom renderer, you’ll need to register a mime type with Mime::Type.register.

    +

    Note that we used Mime for the csv mime type as it comes with Rails. For a custom renderer, you’ll need to register a mime type with Mime::Type.register.

    To use the csv renderer in a controller action:

    @@ -298,7 +298,7 @@

    Called by render in AbstractController::Rendering which sets the return value as the response_body.

    -

    If no renderer is found, super returns control to ActionView::Rendering.render_to_body, if present.

    +

    If no renderer is found, super returns control to ActionView::Rendering.render_to_body, if present.

    diff --git a/src/7.2/classes/ActionController/Renderers/ClassMethods.html b/src/7.2/classes/ActionController/Renderers/ClassMethods.html index f1c8b011c9..3c9b736e49 100644 --- a/src/7.2/classes/ActionController/Renderers/ClassMethods.html +++ b/src/7.2/classes/ActionController/Renderers/ClassMethods.html @@ -103,7 +103,7 @@

    Since ActionController::Metal controllers cannot render, the controller must include AbstractController::Rendering, ActionController::Rendering, and ActionController::Renderers, and have at least one renderer.

    -

    Rather than including ActionController::Renderers::All and including all renderers, you may specify which renderers to include by passing the renderer name or names to use_renderers. For example, a controller that includes only the :json renderer (_render_with_renderer_json) might look like:

    +

    Rather than including ActionController::Renderers::All and including all renderers, you may specify which renderers to include by passing the renderer name or names to use_renderers. For example, a controller that includes only the :json renderer (_render_with_renderer_json) might look like:

    class MetalRenderingController < ActionController::Metal
       include AbstractController::Rendering
    @@ -118,7 +118,7 @@ 

    end

    -

    You must specify a use_renderer, else the controller.renderer and controller._renderers will be nil, and the action will fail.

    +

    You must specify a use_renderer, else the controller.renderer and controller._renderers will be nil, and the action will fail.

    diff --git a/src/7.2/classes/ActionController/Rendering.html b/src/7.2/classes/ActionController/Rendering.html index f8bdfc9f7e..1e273e6d68 100644 --- a/src/7.2/classes/ActionController/Rendering.html +++ b/src/7.2/classes/ActionController/Rendering.html @@ -128,7 +128,7 @@

    Rendering Mode

    -
    :partial +
    :partial

    See ActionView::PartialRenderer for details.

    @@ -136,7 +136,7 @@

    Ren
        render partial: "posts/form", locals: { post: Post.new }
         # => renders app/views/posts/_form.html.erb
     
    -
    :file +
    :file

    Renders the contents of a file. This option should not be used with unsanitized user input.

    @@ -144,7 +144,7 @@

    Ren
        render file: "/path/to/some/file"
         # => renders /path/to/some/file
     
    -
    :inline +
    :inline

    Renders an ERB template string.

    @@ -153,7 +153,7 @@

    Ren render inline: "<h1>Hello, <%= @name %>!</h1>" # => renders "<h1>Hello, World!</h1>" -
    :body +
    :body

    Renders the provided text, and sets the content type as text/plain.

    @@ -161,7 +161,7 @@

    Ren
        render body: "Hello, World!"
         # => renders "Hello, World!"
     
    -
    :plain +
    :plain

    Renders the provided text, and sets the content type as text/plain.

    @@ -169,7 +169,7 @@

    Ren
        render plain: "Hello, World!"
         # => renders "Hello, World!"
     
    -
    :html +
    :html

    Renders the provided HTML string, and sets the content type as text/html. If the string is not html_safe?, performs HTML escaping on the string before rendering.

    @@ -180,7 +180,7 @@

    Ren render html: "<h1>Hello, World!</h1>" # => renders "&lt;h1&gt;Hello, World!&lt;/h1&gt;" -
    :json +
    :json

    Renders the provided object as JSON, and sets the content type as application/json. If the object is not a string, it will be converted to JSON by calling to_json.

    @@ -188,7 +188,7 @@

    Ren
        render json: { hello: "world" }
         # => renders "{\"hello\":\"world\"}"
     
    -
    :renderable +
    :renderable

    Renders the provided object by calling render_in with the current view context. The response format is determined by calling format on the renderable if it responds to format, falling back to text/html by default.

    @@ -200,7 +200,7 @@

    Ren

    By default, when a rendering mode is specified, no layout template is rendered.

    Options

    -
    :assigns +
    :assigns

    Hash of instance variable assignments for the template.

    @@ -208,7 +208,7 @@

    Options

        render inline: "<h1>Hello, <%= @name %>!</h1>", assigns: { name: "World" }
         # => renders "<h1>Hello, World!</h1>"
     
    -
    :locals +
    :locals

    Hash of local variable assignments for the template.

    @@ -216,7 +216,7 @@

    Options

        render inline: "<h1>Hello, <%= name %>!</h1>", locals: { name: "World" }
         # => renders "<h1>Hello, World!</h1>"
     
    -
    :layout +
    :layout

    The layout template to render. Can also be false or true to disable or (re)enable the default layout template.

    @@ -230,7 +230,7 @@

    Options

    render inline: "<h1>Hello, World!</h1>", layout: true # => renders "<h1>Hello, World!</h1>" with the default layout
    -
    :status +
    :status

    The HTTP status code to send with the response. Can be specified as a number or as the status name in Symbol form. Defaults to 200.

    diff --git a/src/7.2/classes/ActionController/RequestForgeryProtection.html b/src/7.2/classes/ActionController/RequestForgeryProtection.html index 4c635609d6..31ad92ccbc 100644 --- a/src/7.2/classes/ActionController/RequestForgeryProtection.html +++ b/src/7.2/classes/ActionController/RequestForgeryProtection.html @@ -674,7 +674,7 @@

    -

    If the verify_authenticity_token before_action ran, verify that JavaScript responses are only served to same-origin GET requests.

    +

    If the verify_authenticity_token before_action ran, verify that JavaScript responses are only served to same-origin GET requests.

    @@ -1279,7 +1279,7 @@

    -

    If verify_authenticity_token was run (indicating that we have forgery protection enabled for this request) then also verify that we aren’t serving an unauthorized cross-origin response.

    +

    If verify_authenticity_token was run (indicating that we have forgery protection enabled for this request) then also verify that we aren’t serving an unauthorized cross-origin response.

    diff --git a/src/7.2/classes/ActionController/TestCase.html b/src/7.2/classes/ActionController/TestCase.html index 7f8ceaad17..1980ef6967 100644 --- a/src/7.2/classes/ActionController/TestCase.html +++ b/src/7.2/classes/ActionController/TestCase.html @@ -71,13 +71,13 @@

    Basic example

    Special instance variables

    ActionController::TestCase will also automatically provide the following instance variables for use in the tests:

    -
    @controller +
    @controller

    The controller instance that will be tested.

    -
    @request +
    @request

    An ActionController::TestRequest, representing the current HTTP request. You can modify this object before sending the HTTP request. For example, you might want to set some session properties before sending a GET request.

    -
    @response +
    @response

    An ActionDispatch::TestResponse object, representing the response of the last HTTP response. In the above example, @response becomes valid after calling post. If the various assert methods are not sufficient, then you may use this object to inspect the HTTP response in detail.

    diff --git a/src/7.2/classes/ActionController/TestCase/Behavior/ClassMethods.html b/src/7.2/classes/ActionController/TestCase/Behavior/ClassMethods.html index 052468cadc..0e7ddb2a06 100644 --- a/src/7.2/classes/ActionController/TestCase/Behavior/ClassMethods.html +++ b/src/7.2/classes/ActionController/TestCase/Behavior/ClassMethods.html @@ -189,7 +189,7 @@

    -

    Sets the controller class name. Useful if the name can’t be inferred from test class. Normalizes controller_class before using.

    +

    Sets the controller class name. Useful if the name can’t be inferred from test class. Normalizes controller_class before using.

    tests WidgetController
     tests :widget
    diff --git a/src/7.2/classes/ActionDispatch/Assertions/RoutingAssertions.html b/src/7.2/classes/ActionDispatch/Assertions/RoutingAssertions.html
    index f586ebf5f3..eb9ee288f4 100644
    --- a/src/7.2/classes/ActionDispatch/Assertions/RoutingAssertions.html
    +++ b/src/7.2/classes/ActionDispatch/Assertions/RoutingAssertions.html
    @@ -103,7 +103,7 @@ 

    -

    Asserts that the provided options can be used to generate the provided path. This is the inverse of assert_recognizes. The extras parameter is used to tell the request the names and values of additional request parameters that would be in a query string. The message parameter allows you to specify a custom error message for assertion failures.

    +

    Asserts that the provided options can be used to generate the provided path. This is the inverse of assert_recognizes. The extras parameter is used to tell the request the names and values of additional request parameters that would be in a query string. The message parameter allows you to specify a custom error message for assertion failures.

    The defaults parameter is unused.

    @@ -250,7 +250,7 @@

    -

    Asserts that path and options match both ways; in other words, it verifies that path generates options and then that options generates path. This essentially combines assert_recognizes and assert_generates into one step.

    +

    Asserts that path and options match both ways; in other words, it verifies that path generates options and then that options generates path. This essentially combines assert_recognizes and assert_generates into one step.

    The extras hash allows you to specify options that would normally be provided as a query string to the action. The message parameter allows you to specify a custom error message to display upon failure.

    diff --git a/src/7.2/classes/ActionDispatch/Cookies.html b/src/7.2/classes/ActionDispatch/Cookies.html index 061be91940..a0a792c71d 100644 --- a/src/7.2/classes/ActionDispatch/Cookies.html +++ b/src/7.2/classes/ActionDispatch/Cookies.html @@ -99,7 +99,7 @@

  • :path - The path for which this cookie applies. Defaults to the root of the application.

  • -

    :domain - The domain for which this cookie applies so you can restrict to the domain level. If you use a schema like www.example.com and want to share session with user.example.com set :domain to :all. To support multiple domains, provide an array, and the first domain matching request.host will be used. Make sure to specify the :domain option with :all or Array again when deleting cookies. For more flexibility you can set the domain on a per-request basis by specifying :domain with a proc.

    +

    :domain - The domain for which this cookie applies so you can restrict to the domain level. If you use a schema like www.example.com and want to share session with user.example.com set :domain to :all. To support multiple domains, provide an array, and the first domain matching request.host will be used. Make sure to specify the :domain option with :all or Array again when deleting cookies. For more flexibility you can set the domain on a per-request basis by specifying :domain with a proc.

    domain: nil  # Does not set cookie domain. (default)
     domain: :all # Allow the cookie for the top most level
    diff --git a/src/7.2/classes/ActionDispatch/Http/Cache/Response.html b/src/7.2/classes/ActionDispatch/Http/Cache/Response.html
    index 5f1e0e3d1f..682d7922a0 100644
    --- a/src/7.2/classes/ActionDispatch/Http/Cache/Response.html
    +++ b/src/7.2/classes/ActionDispatch/Http/Cache/Response.html
    @@ -304,7 +304,7 @@ 

    Weak ETags are considered to be semantically equivalent but not byte-for-byte identical. This is perfect for browser caching of HTML pages where we don’t care about exact equality, just what the user is viewing.

    -

    Strong ETags are considered byte-for-byte identical. They allow a browser or proxy cache to support Range requests, useful for paging through a PDF file or scrubbing through a video. Some CDNs only support strong ETags and will ignore weak ETags entirely.

    +

    Strong ETags are considered byte-for-byte identical. They allow a browser or proxy cache to support Range requests, useful for paging through a PDF file or scrubbing through a video. Some CDNs only support strong ETags and will ignore weak ETags entirely.

    Weak ETags are what we almost always need, so they’re the default. Check out

    diff --git a/src/7.2/classes/ActionDispatch/Http/FilterParameters.html b/src/7.2/classes/ActionDispatch/Http/FilterParameters.html index 4ceb8f065c..b4379e414a 100644 --- a/src/7.2/classes/ActionDispatch/Http/FilterParameters.html +++ b/src/7.2/classes/ActionDispatch/Http/FilterParameters.html @@ -257,7 +257,7 @@

    -

    Returns the ActiveSupport::ParameterFilter object used to filter in this request.

    +

    Returns the ActiveSupport::ParameterFilter object used to filter in this request.

    diff --git a/src/7.2/classes/ActionDispatch/Integration/Session.html b/src/7.2/classes/ActionDispatch/Integration/Session.html index 46aac221db..b08cc41106 100644 --- a/src/7.2/classes/ActionDispatch/Integration/Session.html +++ b/src/7.2/classes/ActionDispatch/Integration/Session.html @@ -418,7 +418,7 @@

    as: Used for encoding the request with different content type. Supports :json by default and will set the appropriate request headers. The headers will be merged into the Rack env hash.

  • -

    This method is rarely used directly. Use RequestHelpers#get, RequestHelpers#post, or other standard HTTP methods in integration tests. #process is only required when using a request method that doesn’t have a method defined in the integration tests.

    +

    This method is rarely used directly. Use RequestHelpers#get, RequestHelpers#post, or other standard HTTP methods in integration tests. process is only required when using a request method that doesn’t have a method defined in the integration tests.

    This method returns the response status, after performing the request. Furthermore, if this method was called from an ActionDispatch::IntegrationTest object, then that object’s @response instance variable will point to a Response object which one can use to inspect the details of the response.

    diff --git a/src/7.2/classes/ActionDispatch/IntegrationTest.html b/src/7.2/classes/ActionDispatch/IntegrationTest.html index 343d4153b7..cb5926be34 100644 --- a/src/7.2/classes/ActionDispatch/IntegrationTest.html +++ b/src/7.2/classes/ActionDispatch/IntegrationTest.html @@ -31,7 +31,7 @@

    An integration test spans multiple controllers and actions, tying them all together to ensure they work together as expected. It tests more completely than either unit or functional tests do, exercising the entire stack, from the dispatcher to the database.

    -

    At its simplest, you simply extend IntegrationTest and write your tests using the Integration::RequestHelpers#get and/or Integration::RequestHelpers#post methods:

    +

    At its simplest, you simply extend IntegrationTest and write your tests using the Integration::RequestHelpers#get and/or Integration::RequestHelpers#post methods:

    require "test_helper"
     
    diff --git a/src/7.2/classes/ActionDispatch/RemoteIp.html b/src/7.2/classes/ActionDispatch/RemoteIp.html
    index 25d3083f22..76461f895e 100644
    --- a/src/7.2/classes/ActionDispatch/RemoteIp.html
    +++ b/src/7.2/classes/ActionDispatch/RemoteIp.html
    @@ -149,11 +149,11 @@ 

    -

    Create a new RemoteIp middleware instance.

    +

    Create a new RemoteIp middleware instance.

    The ip_spoofing_check option is on by default. When on, an exception is raised if it looks like the client is trying to lie about its own IP address. It makes sense to turn off this check on sites aimed at non-IP clients (like WAP devices), or behind proxies that set headers in an incorrect or confusing way (like AWS ELB).

    -

    The custom_proxies argument can take an enumerable which will be used instead of TRUSTED_PROXIES. Any proxy setup will put the value you want in the middle (or at the beginning) of the X-Forwarded-For list, with your proxy servers after it. If your proxies aren’t removed, pass them in via the custom_proxies parameter. That way, the middleware will ignore those IP addresses, and return the one that you want.

    +

    The custom_proxies argument can take an enumerable which will be used instead of TRUSTED_PROXIES. Any proxy setup will put the value you want in the middle (or at the beginning) of the X-Forwarded-For list, with your proxy servers after it. If your proxies aren’t removed, pass them in via the custom_proxies parameter. That way, the middleware will ignore those IP addresses, and return the one that you want.

    diff --git a/src/7.2/classes/ActionDispatch/Request.html b/src/7.2/classes/ActionDispatch/Request.html index 80e9e1ce08..93190cb0a9 100644 --- a/src/7.2/classes/ActionDispatch/Request.html +++ b/src/7.2/classes/ActionDispatch/Request.html @@ -943,7 +943,7 @@

    -

    Returns the String full path including params of the last URL requested.

    +

    Returns the String full path including params of the last URL requested.

    # get "/articles"
     request.fullpath # => "/articles"
    @@ -1058,7 +1058,7 @@ 

    -

    Returns the IP address of client as a String.

    +

    Returns the IP address of client as a String.

    @@ -1201,7 +1201,7 @@

    -

    The String MIME type of the request.

    +

    The String MIME type of the request.

    # get "/articles"
     request.media_type # => "application/x-www-form-urlencoded"
    @@ -1319,7 +1319,7 @@ 

    -

    Returns a String with the last requested path including their params.

    +

    Returns a String with the last requested path including their params.

    # get '/foo'
     request.original_fullpath # => '/foo'
    @@ -1361,7 +1361,7 @@ 

    -

    Returns the original request URL as a String.

    +

    Returns the original request URL as a String.

    # get "/articles?page=2"
     request.original_url # => "http://www.example.com/articles?page=2"
    @@ -1463,7 +1463,7 @@ 

    -

    Returns the IP address of client as a String, usually set by the RemoteIp middleware.

    +

    Returns the IP address of client as a String, usually set by the RemoteIp middleware.

    @@ -1819,7 +1819,7 @@

    If the env contains rack.early_hints then the server accepts HTTP2 push for link headers.

    -

    The send_early_hints method accepts a hash of links as follows:

    +

    The send_early_hints method accepts a hash of links as follows:

    send_early_hints("link" => "</style.css>; rel=preload; as=style,</script.js>; rel=preload")
     
    diff --git a/src/7.2/classes/ActionDispatch/Routing/Mapper/Base.html b/src/7.2/classes/ActionDispatch/Routing/Mapper/Base.html index ab27633f94..ebe510639c 100644 --- a/src/7.2/classes/ActionDispatch/Routing/Mapper/Base.html +++ b/src/7.2/classes/ActionDispatch/Routing/Mapper/Base.html @@ -240,13 +240,13 @@

    Options

    Any options not seen here are passed on as params with the URL.

    -
    :controller +
    :controller

    The route’s controller.

    -
    :action +
    :action

    The route’s action.

    -
    :param +
    :param

    Overrides the default resource identifier :id (name of the dynamic segment used to generate the routes). You can access that segment from your controller using params[<:param>]. In your router:

    @@ -275,10 +275,10 @@

    Options

    user = User.find_by(name: 'Phusion') user_path(user) # => "/users/Phusion"
    -
    :path +
    :path

    The path prefix for the routes.

    -
    :module +
    :module

    The namespace for :controller.

    @@ -288,10 +288,10 @@

    Options

    See `Scoping#namespace` for its scope equivalent.

    -
    :as +
    :as

    The name used to generate routing helpers.

    -
    :via +
    :via

    Allowed HTTP verb(s) for route.

    @@ -300,7 +300,7 @@

    Options

    match 'path', to: 'c#a', via: [:get, :post] match 'path', to: 'c#a', via: :all

    -
    :to +
    :to

    Points to a Rack endpoint. Can be an object that responds to call or a string representing a controller’s action.

    @@ -309,7 +309,7 @@

    Options

    match 'path', to: -> (env) { [200, {}, ["Success!"]] }, via: :get match 'path', to: RackApp, via: :get

    -
    :on +
    :on

    Shorthand for wrapping routes in a specific RESTful context. Valid values are :member, :collection, and :new. Only use within resource(s) block. For example:

    @@ -326,7 +326,7 @@

    Options

    end end

    -
    :constraints +
    :constraints

    Constrains parameters with a hash of regular expressions or an object that responds to matches?. In addition, constraints other than path can also be specified with any object that responds to === (e.g. String, Array, Range, etc.).

    @@ -342,7 +342,7 @@

    Options

    See `Scoping#constraints` for more examples with its scope equivalent.

    -
    :defaults +
    :defaults

    Sets defaults for parameters

    @@ -352,7 +352,7 @@

    Options

    See `Scoping#defaults` for its scope equivalent. -
    :anchor +
    :anchor

    Boolean to anchor a match pattern. Default is true. When set to false, the pattern matches any request prefixed with the given path.

    @@ -360,7 +360,7 @@

    Options

        # Matches any request starting with 'path'
         match 'path', to: 'c#a', anchor: false, via: :get
     
    -
    :format +
    :format

    Allows you to specify the default value for optional format segment or disable it by supplying false.

    diff --git a/src/7.2/classes/ActionDispatch/Routing/Mapper/CustomUrls.html b/src/7.2/classes/ActionDispatch/Routing/Mapper/CustomUrls.html index 58624569de..7479b6f699 100644 --- a/src/7.2/classes/ActionDispatch/Routing/Mapper/CustomUrls.html +++ b/src/7.2/classes/ActionDispatch/Routing/Mapper/CustomUrls.html @@ -112,7 +112,7 @@

    Rails.application.routes.url_helpers.browse_path
     
    -

    then it will raise a NameError. Because of this you need to be aware of the context in which you will use your custom URL helper when defining it.

    +

    then it will raise a NameError. Because of this you need to be aware of the context in which you will use your custom URL helper when defining it.

    NOTE: The direct method can’t be used inside of a scope block such as namespace or scope and will raise an error if it detects that it is.

    diff --git a/src/7.2/classes/ActionDispatch/Routing/Mapper/Resources.html b/src/7.2/classes/ActionDispatch/Routing/Mapper/Resources.html index d720be2b48..a7d01e068f 100644 --- a/src/7.2/classes/ActionDispatch/Routing/Mapper/Resources.html +++ b/src/7.2/classes/ActionDispatch/Routing/Mapper/Resources.html @@ -243,7 +243,7 @@

    -

    Loads another routes file with the given name located inside the config/routes directory. In that file, you can use the normal routing DSL, but do not surround it with a Rails.application.routes.draw block.

    +

    Loads another routes file with the given name located inside the config/routes directory. In that file, you can use the normal routing DSL, but do not surround it with a Rails.application.routes.draw block.

    # config/routes.rb
     Rails.application.routes.draw do
    @@ -687,7 +687,7 @@ 

    Options

    Takes same options as match as well as:

    -
    :path_names +
    :path_names

    Allows you to change the segment component of the edit and new actions. Actions not specified are not changed.

    @@ -696,7 +696,7 @@

    Options

    The above example will now change /posts/new to /posts/brand_new.
    -
    :path +
    :path

    Allows you to change the path prefix for the resource.

    @@ -706,7 +706,7 @@

    Options

    The resource and all segments will now route to /postings instead of /posts. -
    :only +
    :only

    Only generate routes for the given actions.

    @@ -714,7 +714,7 @@

    Options

        resources :cows, only: :show
         resources :cows, only: [:show, :index]
     
    -
    :except +
    :except

    Generate all routes except for the given actions.

    @@ -722,7 +722,7 @@

    Options

        resources :cows, except: :show
         resources :cows, except: [:show, :index]
     
    -
    :shallow +
    :shallow

    Generates shallow routes for nested resource(s). When placed on a parent resource, generates shallow routes for all nested resources.

    @@ -745,7 +745,7 @@

    Options

    Set `shallow: false` on a child resource to ignore a parent's shallow parameter. -
    :shallow_path +
    :shallow_path

    Prefixes nested shallow routes with the specified path.

    @@ -767,7 +767,7 @@

    Options

    comment PATCH/PUT /sekret/comments/:id(.:format) comment DELETE /sekret/comments/:id(.:format) -
    :shallow_prefix +
    :shallow_prefix

    Prefixes nested shallow route names with specified prefix.

    @@ -789,10 +789,10 @@

    Options

    sekret_comment PATCH/PUT /comments/:id(.:format) sekret_comment DELETE /comments/:id(.:format) -
    :format +
    :format

    Allows you to specify the default value for optional format segment or disable it by supplying false.

    -
    :param +
    :param

    Allows you to override the default param name of :id in the URL.

    diff --git a/src/7.2/classes/ActionDispatch/Routing/Mapper/Scoping.html b/src/7.2/classes/ActionDispatch/Routing/Mapper/Scoping.html index b7c017b431..578ecf0318 100644 --- a/src/7.2/classes/ActionDispatch/Routing/Mapper/Scoping.html +++ b/src/7.2/classes/ActionDispatch/Routing/Mapper/Scoping.html @@ -340,7 +340,7 @@

    Options

    The :path, :as, :module, :shallow_path, and :shallow_prefix options all default to the name of the namespace.

    -

    For options, see Base#match. For :shallow_path option, see Resources#resources.

    +

    For options, see Base#match. For :shallow_path option, see Resources#resources.

    # accessible through /sekret/posts rather than /admin/posts
     namespace :admin, path: "sekret" do
    @@ -415,7 +415,7 @@ 

    Options

    -

    Takes same options as Base#match and Resources#resources.

    +

    Takes same options as Base#match and Resources#resources.

    # route /posts (without the prefix /admin) to +Admin::PostsController+
     scope module: "admin" do
    diff --git a/src/7.2/classes/ActionDispatch/Routing/PolymorphicRoutes.html b/src/7.2/classes/ActionDispatch/Routing/PolymorphicRoutes.html
    index 34ff234ebe..9925c4e1ee 100644
    --- a/src/7.2/classes/ActionDispatch/Routing/PolymorphicRoutes.html
    +++ b/src/7.2/classes/ActionDispatch/Routing/PolymorphicRoutes.html
    @@ -45,9 +45,9 @@ 

    Rails framework:

    • -

      url_for, so you can use it with a record as the argument, e.g. url_for(@article);

      +

      url_for, so you can use it with a record as the argument, e.g. article) at url_for(;

    • -

      ActionView::Helpers::FormHelper uses polymorphic_path, so you can write form_for(@article) without having to specify :url parameter for the form action;

      +

      ActionView::Helpers::FormHelper uses polymorphic_path, so you can write article) at form_for( without having to specify :url parameter for the form action;

    • redirect_to (which, in fact, uses url_for) so you can write redirect_to(post) in your controllers;

    • @@ -56,7 +56,7 @@

      Prefixed polymorphic helpers

      -

      In addition to polymorphic_url and polymorphic_path methods, a number of prefixed helpers are available as a shorthand to action: "..." in options. Those are:

      +

      In addition to polymorphic_url and polymorphic_path methods, a number of prefixed helpers are available as a shorthand to action: "..." in options. Those are:

      • edit_polymorphic_url, edit_polymorphic_path

      • diff --git a/src/7.2/classes/ActionDispatch/Routing/UrlFor.html b/src/7.2/classes/ActionDispatch/Routing/UrlFor.html index 6440792081..823c9814e0 100644 --- a/src/7.2/classes/ActionDispatch/Routing/UrlFor.html +++ b/src/7.2/classes/ActionDispatch/Routing/UrlFor.html @@ -29,7 +29,7 @@

        ActionDispatch::Routing for general information about routing and config/routes.rb.

        -

        Tip: If you need to generate URLs from your models or some other place, then ActionDispatch::Routing::UrlFor is what you’re looking for. Read on for an introduction. In general, this module should not be included on its own, as it is usually included by url_helpers (as in Rails.application.routes.url_helpers).

        +

        Tip: If you need to generate URLs from your models or some other place, then ActionDispatch::Routing::UrlFor is what you’re looking for. Read on for an introduction. In general, this module should not be included on its own, as it is usually included by url_helpers (as in Rails.application.routes.url_helpers).

        URL generation from parameters

        @@ -60,7 +60,7 @@

        url_for, that already knows what the current hostname is. So if you use url_for in your controllers or your views, then you don’t need to explicitly pass the :host argument.

        For convenience, mailers also include ActionDispatch::Routing::UrlFor. So within mailers, you can use url_for. However, mailers cannot access incoming web requests in order to derive hostname information, so you have to provide the :host option or set the default host using default_url_options. For more information on url_for in mailers see the ActionMailer::Base documentation.

        @@ -71,7 +71,7 @@

        Rails.application.routes.url_helpers in your class:

        class User < ActiveRecord::Base
           include Rails.application.routes.url_helpers
        @@ -287,7 +287,7 @@ 

        :script_name - Specifies application path relative to domain root. If provided, prepends application path.

      -

      Any other key (:controller, :action, etc.) given to url_for is forwarded to the Routes module.

      +

      Any other key (:controller, :action, etc.) given to url_for is forwarded to the Routes module.

      url_for controller: 'tasks', action: 'testing', host: 'somehost.org', port: '8080'
       # => 'http://somehost.org:8080/tasks/testing'
      @@ -310,7 +310,7 @@ 

      url_for(only_path: true, action: 'edit', id: 2) # => '/users/2/edit'

      -

      Notice that no :id parameter was provided to the first url_for call and the helper used the one from the route’s path. Any path parameter implicitly used by url_for can always be overwritten like shown on the last url_for calls.

      +

      Notice that no :id parameter was provided to the first url_for call and the helper used the one from the route’s path. Any path parameter implicitly used by url_for can always be overwritten like shown on the last url_for calls.

    diff --git a/src/7.2/classes/ActionDispatch/Session/CacheStore.html b/src/7.2/classes/ActionDispatch/Session/CacheStore.html index a1cb2b810f..5518904de2 100644 --- a/src/7.2/classes/ActionDispatch/Session/CacheStore.html +++ b/src/7.2/classes/ActionDispatch/Session/CacheStore.html @@ -35,7 +35,7 @@

    Options

    • -

      cache - The cache to use. If it is not specified, Rails.cache will be used.

      +

      cache - The cache to use. If it is not specified, Rails.cache will be used.

    • expire_after - The length of time a session will be stored before automatically expiring. By default, the :expires_in option of the cache is used.

    diff --git a/src/7.2/classes/ActionDispatch/ShowExceptions.html b/src/7.2/classes/ActionDispatch/ShowExceptions.html index 467862e45a..d6bf2f8f9e 100644 --- a/src/7.2/classes/ActionDispatch/ShowExceptions.html +++ b/src/7.2/classes/ActionDispatch/ShowExceptions.html @@ -33,7 +33,7 @@

    ShowExceptions. Every time there is an exception, ShowExceptions will store the exception in env["action_dispatch.exception"], rewrite the PATH_INFO to the exception status code, and call the Rack app.

    In Rails applications, the exceptions app can be configured with config.exceptions_app, which defaults to ActionDispatch::PublicExceptions.

    diff --git a/src/7.2/classes/ActionDispatch/SystemTestCase.html b/src/7.2/classes/ActionDispatch/SystemTestCase.html index ab44aaf347..dcf03736ca 100644 --- a/src/7.2/classes/ActionDispatch/SystemTestCase.html +++ b/src/7.2/classes/ActionDispatch/SystemTestCase.html @@ -61,7 +61,7 @@

    System Testin end -

    By default, ActionDispatch::SystemTestCase is driven by the Selenium driver, with the Chrome browser, and a browser size of 1400x1400.

    +

    By default, ActionDispatch::SystemTestCase is driven by the Selenium driver, with the Chrome browser, and a browser size of 1400x1400.

    Changing the driver configuration options is easy. Let’s say you want to use the Firefox browser instead of Chrome. In your application_system_test_case.rb file add the following:

    @@ -72,7 +72,7 @@

    System Testin end -

    driven_by has a required argument for the driver name. The keyword arguments are :using for the browser and :screen_size to change the size of the browser screen. These two options are not applicable for headless drivers and will be silently ignored if passed.

    +

    driven_by has a required argument for the driver name. The keyword arguments are :using for the browser and :screen_size to change the size of the browser screen. These two options are not applicable for headless drivers and will be silently ignored if passed.

    Headless browsers such as headless Chrome and headless Firefox are also supported. You can use these browsers by setting the :using argument to :headless_chrome or :headless_firefox.

    @@ -101,7 +101,7 @@

    System Testin end -

    Because ActionDispatch::SystemTestCase is a shim between Capybara and Rails, any driver that is supported by Capybara is supported by system tests as long as you include the required gems and files.

    +

    Because ActionDispatch::SystemTestCase is a shim between Capybara and Rails, any driver that is supported by Capybara is supported by system tests as long as you include the required gems and files.

    diff --git a/src/7.2/classes/ActionDispatch/SystemTesting/TestHelpers/ScreenshotHelper.html b/src/7.2/classes/ActionDispatch/SystemTesting/TestHelpers/ScreenshotHelper.html index f374d4cdd7..f0c618b95a 100644 --- a/src/7.2/classes/ActionDispatch/SystemTesting/TestHelpers/ScreenshotHelper.html +++ b/src/7.2/classes/ActionDispatch/SystemTesting/TestHelpers/ScreenshotHelper.html @@ -78,7 +78,7 @@

    Takes a screenshot of the current page in the browser if the test failed.

    -

    take_failed_screenshot is called during system test teardown.

    +

    take_failed_screenshot is called during system test teardown.

    @@ -118,7 +118,7 @@

    Takes a screenshot of the current page in the browser.

    -

    take_screenshot can be used at any point in your system tests to take a screenshot of the current state. This can be useful for debugging or automating visual testing. You can take multiple screenshots per test to investigate changes at different points during your test. These will be named with a sequential prefix (or ‘failed’ for failing tests)

    +

    take_screenshot can be used at any point in your system tests to take a screenshot of the current state. This can be useful for debugging or automating visual testing. You can take multiple screenshots per test to investigate changes at different points during your test. These will be named with a sequential prefix (or ‘failed’ for failing tests)

    The default screenshots directory is tmp/screenshots but you can set a different one with Capybara.save_path

    diff --git a/src/7.2/classes/ActionMailbox.html b/src/7.2/classes/ActionMailbox.html index b5a223bb1c..104c5e5e81 100644 --- a/src/7.2/classes/ActionMailbox.html +++ b/src/7.2/classes/ActionMailbox.html @@ -81,7 +81,7 @@

    Action Mailbox

    Action Mailbox routes incoming emails to controller-like mailboxes for processing in Rails. It ships with ingresses for Mailgun, Mandrill, Postmark, and SendGrid. You can also handle inbound mails directly via the built-in Exim, Postfix, and Qmail ingresses.

    -

    The inbound emails are turned into InboundEmail records using Active Record and feature lifecycle tracking, storage of the original email on cloud storage via Active Storage, and responsible data handling with on-by-default incineration.

    +

    The inbound emails are turned into InboundEmail records using Active Record and feature lifecycle tracking, storage of the original email on cloud storage via Active Storage, and responsible data handling with on-by-default incineration.

    These inbound emails are routed asynchronously using Active Job to one or several dedicated mailboxes, which are capable of interacting directly with the rest of your domain model.

    diff --git a/src/7.2/classes/ActionMailbox/Base.html b/src/7.2/classes/ActionMailbox/Base.html index a9f99a00b2..26c2abd75a 100644 --- a/src/7.2/classes/ActionMailbox/Base.html +++ b/src/7.2/classes/ActionMailbox/Base.html @@ -53,7 +53,7 @@

    Action Mailbox Base

    Application mailboxes need to override the process method, which is invoked by the framework after callbacks have been run. The callbacks available are: before_processing, after_processing, and around_processing. The primary use case is to ensure that certain preconditions to processing are fulfilled using before_processing callbacks.

    -

    If a precondition fails to be met, you can halt the processing using the #bounced! method, which will silently prevent any further processing, but not actually send out any bounce notice. You can also pair this behavior with the invocation of an Action Mailer class responsible for sending out an actual bounce email. This is done using the bounce_with method, which takes the mail object returned by an Action Mailer method, like so:

    +

    If a precondition fails to be met, you can halt the processing using the bounced! method, which will silently prevent any further processing, but not actually send out any bounce notice. You can also pair this behavior with the invocation of an Action Mailer class responsible for sending out an actual bounce email. This is done using the bounce_with method, which takes the mail object returned by an Action Mailer method, like so:

    class ForwardsMailbox < ApplicationMailbox
       before_processing :ensure_sender_is_a_user
    diff --git a/src/7.2/classes/ActionMailbox/InboundEmail.html b/src/7.2/classes/ActionMailbox/InboundEmail.html
    index 9c5a30327e..c8b941f7e8 100644
    --- a/src/7.2/classes/ActionMailbox/InboundEmail.html
    +++ b/src/7.2/classes/ActionMailbox/InboundEmail.html
    @@ -37,7 +37,7 @@ 

    -

    The InboundEmail is an Active Record that keeps a reference to the raw email stored in Active Storage and tracks the status of processing. By default, incoming emails will go through the following lifecycle:

    +

    The InboundEmail is an Active Record that keeps a reference to the raw email stored in Active Storage and tracks the status of processing. By default, incoming emails will go through the following lifecycle:

    • Pending: Just received by one of the ingress controllers and scheduled for routing.

    • @@ -45,14 +45,14 @@

    • Delivered: Successfully processed by the specific mailbox.

    • -

      Failed: An exception was raised during the specific mailbox’s execution of the #process method.

      +

      Failed: An exception was raised during the specific mailbox’s execution of the process method.

    • Bounced: Rejected processing by the specific mailbox and bounced to sender.

    -

    Once the InboundEmail has reached the status of being either delivered, failed, or bounced, it’ll count as having been #processed?. Once processed, the InboundEmail will be scheduled for automatic incineration at a later point.

    +

    Once the InboundEmail has reached the status of being either delivered, failed, or bounced, it’ll count as having been processed?. Once processed, the InboundEmail will be scheduled for automatic incineration at a later point.

    -

    When working with an InboundEmail, you’ll usually interact with the parsed version of the source, which is available as a Mail object from #mail. But you can also access the raw source directly using the #source method.

    +

    When working with an InboundEmail, you’ll usually interact with the parsed version of the source, which is available as a Mail object from mail. But you can also access the raw source directly using the source method.

    Examples:

    diff --git a/src/7.2/classes/ActionMailbox/InboundEmail/Incineratable.html b/src/7.2/classes/ActionMailbox/InboundEmail/Incineratable.html index db9c67abbe..cc2e623b84 100644 --- a/src/7.2/classes/ActionMailbox/InboundEmail/Incineratable.html +++ b/src/7.2/classes/ActionMailbox/InboundEmail/Incineratable.html @@ -25,7 +25,7 @@

    -

    Ensure that the InboundEmail is automatically scheduled for later incineration if the status has been changed to processed. The later incineration will be invoked at the time specified by the ActionMailbox.incinerate_after time using the IncinerationJob.

    +

    Ensure that the InboundEmail is automatically scheduled for later incineration if the status has been changed to processed. The later incineration will be invoked at the time specified by the ActionMailbox.incinerate_after time using the IncinerationJob.

    diff --git a/src/7.2/classes/ActionMailbox/InboundEmail/Incineratable/Incineration.html b/src/7.2/classes/ActionMailbox/InboundEmail/Incineratable/Incineration.html index a19c91b544..08aef384fb 100644 --- a/src/7.2/classes/ActionMailbox/InboundEmail/Incineratable/Incineration.html +++ b/src/7.2/classes/ActionMailbox/InboundEmail/Incineratable/Incineration.html @@ -29,7 +29,7 @@

    -

    Command class for carrying out the actual incineration of the InboundMail that’s been scheduled for removal. Before the incineration – which really is just a call to #destroy! – is run, we verify that it’s both eligible (by virtue of having already been processed) and time to do so (that is, the InboundEmail was processed after the incinerate_after time).

    +

    Command class for carrying out the actual incineration of the InboundMail that’s been scheduled for removal. Before the incineration – which really is just a call to destroy! – is run, we verify that it’s both eligible (by virtue of having already been processed) and time to do so (that is, the InboundEmail was processed after the incinerate_after time).

    diff --git a/src/7.2/classes/ActionMailbox/InboundEmail/MessageId.html b/src/7.2/classes/ActionMailbox/InboundEmail/MessageId.html index ff863cb242..0dbe7b314e 100644 --- a/src/7.2/classes/ActionMailbox/InboundEmail/MessageId.html +++ b/src/7.2/classes/ActionMailbox/InboundEmail/MessageId.html @@ -86,7 +86,7 @@

    -

    Create a new InboundEmail from the raw source of the email, which is uploaded as an Active Storage attachment called raw_email. Before the upload, extract the Message-ID from the source and set it as an attribute on the new InboundEmail.

    +

    Create a new InboundEmail from the raw source of the email, which is uploaded as an Active Storage attachment called raw_email. Before the upload, extract the Message-ID from the source and set it as an attribute on the new InboundEmail.

    diff --git a/src/7.2/classes/ActionMailbox/InboundEmail/Routable.html b/src/7.2/classes/ActionMailbox/InboundEmail/Routable.html index a64c4cd820..a2c7cf4d9a 100644 --- a/src/7.2/classes/ActionMailbox/InboundEmail/Routable.html +++ b/src/7.2/classes/ActionMailbox/InboundEmail/Routable.html @@ -23,9 +23,9 @@

    -

    A newly received InboundEmail will not be routed synchronously as part of ingress controller’s receival. Instead, the routing will be done asynchronously, using a RoutingJob, to ensure maximum parallel capacity.

    +

    A newly received InboundEmail will not be routed synchronously as part of ingress controller’s receival. Instead, the routing will be done asynchronously, using a RoutingJob, to ensure maximum parallel capacity.

    -

    By default, all newly created InboundEmail records that have the status of pending, which is the default, will be scheduled for automatic, deferred routing.

    +

    By default, all newly created InboundEmail records that have the status of pending, which is the default, will be scheduled for automatic, deferred routing.

    @@ -78,7 +78,7 @@

    -

    Route this InboundEmail using the routing rules declared on the ApplicationMailbox.

    +

    Route this InboundEmail using the routing rules declared on the ApplicationMailbox.

    @@ -113,7 +113,7 @@

    -

    Enqueue a RoutingJob for this InboundEmail.

    +

    Enqueue a RoutingJob for this InboundEmail.

    diff --git a/src/7.2/classes/ActionMailbox/IncinerationJob.html b/src/7.2/classes/ActionMailbox/IncinerationJob.html index 78e55d8c41..87cff6394b 100644 --- a/src/7.2/classes/ActionMailbox/IncinerationJob.html +++ b/src/7.2/classes/ActionMailbox/IncinerationJob.html @@ -29,9 +29,9 @@

    -

    You can configure when this IncinerationJob will be run as a time-after-processing using the config.action_mailbox.incinerate_after or ActionMailbox.incinerate_after setting.

    +

    You can configure when this IncinerationJob will be run as a time-after-processing using the config.action_mailbox.incinerate_after or ActionMailbox.incinerate_after setting.

    -

    Since this incineration is set for the future, it’ll automatically ignore any InboundEmails that have already been deleted and discard itself if so.

    +

    Since this incineration is set for the future, it’ll automatically ignore any InboundEmails that have already been deleted and discard itself if so.

    You can disable incinerating processed emails by setting config.action_mailbox.incinerate or ActionMailbox.incinerate to false.

    diff --git a/src/7.2/classes/ActionMailer/Base.html b/src/7.2/classes/ActionMailer/Base.html index 6a1e5d7dbf..0a981cc282 100644 --- a/src/7.2/classes/ActionMailer/Base.html +++ b/src/7.2/classes/ActionMailer/Base.html @@ -40,7 +40,7 @@

    Mailer Models

    $ bin/rails generate mailer Notifier
     
    -

    The generated model inherits from ApplicationMailer which in turn inherits from ActionMailer::Base. A mailer model defines methods used to generate an email message. In these methods, you can set up variables to be used in the mailer views, options on the mail itself such as the :from address, and attachments.

    +

    The generated model inherits from ApplicationMailer which in turn inherits from ActionMailer::Base. A mailer model defines methods used to generate an email message. In these methods, you can set up variables to be used in the mailer views, options on the mail itself such as the :from address, and attachments.

    class ApplicationMailer < ActionMailer::Base
       default from: 'from@example.com'
    @@ -72,7 +72,7 @@ 

    Mailer Models

    mail - Allows you to specify email to be sent.

    -

    The hash passed to the mail method allows you to specify any header that a Mail::Message will accept (any valid email header including optional fields).

    +

    The hash passed to the mail method allows you to specify any header that a Mail::Message will accept (any valid email header including optional fields).

    The mail method, if not passed a block, will inspect your views and send all the views with the same name as the method, so the above action would send the welcome.text.erb view file as well as the welcome.html.erb view file in a multipart/alternative email.

    @@ -160,7 +160,7 @@

    Sending mail

    mail.deliver_now # generates and sends the email now
    -

    The ActionMailer::MessageDelivery class is a wrapper around a delegate that will call your method to generate the mail. If you want direct access to the delegator, or Mail::Message, you can call the message method on the ActionMailer::MessageDelivery object.

    +

    The ActionMailer::MessageDelivery class is a wrapper around a delegate that will call your method to generate the mail. If you want direct access to the delegator, or Mail::Message, you can call the message method on the ActionMailer::MessageDelivery object.

    NotifierMailer.welcome(User.first).message     # => a Mail::Message object
     
    @@ -262,7 +262,7 @@

    Observi

    An observer class must implement the :delivered_email(message) method which will be called once for every email sent after the email has been sent.

    -

    An interceptor class must implement the :delivering_email(message) method which will be called before the email is sent, allowing you to make modifications to the email before it hits the delivery agents. Your class should make any needed modifications directly to the passed in Mail::Message instance.

    +

    An interceptor class must implement the :delivering_email(message) method which will be called before the email is sent, allowing you to make modifications to the email before it hits the delivery agents. Your class should make any needed modifications directly to the passed in Mail::Message instance.

    Default Hash

    @@ -273,7 +273,7 @@

    Default Hash

    end

    -

    You can pass in any header value that a Mail::Message accepts. Out of the box, ActionMailer::Base sets the following:

    +

    You can pass in any header value that a Mail::Message accepts. Out of the box, ActionMailer::Base sets the following:

    • mime_version: "1.0"

    • @@ -284,7 +284,7 @@

      Default Hash

      parts_order: [ "text/plain", "text/enriched", "text/html" ]

    -

    parts_order and charset are not actually valid Mail::Message header fields, but Action Mailer translates them appropriately and sets the correct values.

    +

    parts_order and charset are not actually valid Mail::Message header fields, but Action Mailer translates them appropriately and sets the correct values.

    As you can pass in any header, you need to either quote the header as a string, or pass it in as an underscored symbol, so the following will work:

    @@ -308,7 +308,7 @@

    Default Hash

    Note that the proc/lambda is evaluated right at the start of the mail message generation, so if you set something in the default hash using a proc, and then set the same thing inside of your mailer method, it will get overwritten by the mailer method.

    -

    It is also possible to set these default options that will be used in all mailers through the default_options= configuration in config/application.rb:

    +

    It is also possible to set these default options that will be used in all mailers through the default_options= configuration in config/application.rb:

    config.action_mailer.default_options = { from: "no-reply@example.org" }
     
    @@ -372,7 +372,7 @@

    Previewing emails

    end -

    Methods must return a Mail::Message object which can be generated by calling the mailer method without the additional deliver_now / deliver_later. The location of the mailer preview directories can be configured using the preview_paths option which has a default of test/mailers/previews:

    +

    Methods must return a Mail::Message object which can be generated by calling the mailer method without the additional deliver_now / deliver_later. The location of the mailer preview directories can be configured using the preview_paths option which has a default of test/mailers/previews:

    config.action_mailer.preview_paths << "#{Rails.root}/lib/mailer_previews"
     
    @@ -390,7 +390,7 @@

    Previewing emails

    config.action_mailer.preview_interceptors :css_inline_styler -

    Note that interceptors need to be registered both with register_interceptor and register_preview_interceptor if they should operate on both sending and previewing emails.

    +

    Note that interceptors need to be registered both with register_interceptor and register_preview_interceptor if they should operate on both sending and previewing emails.

    Configuration options

    @@ -1369,18 +1369,18 @@

    -

    Allows you to pass random and unusual headers to the new Mail::Message object which will add them to itself.

    +

    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"
     
    -

    You can also pass a hash into headers of header field names and values, which will then be set on the Mail::Message object:

    +

    You can also pass a hash into headers of header field names and values, which will then be set on the Mail::Message object:

    headers 'X-Special-Domain-Specific-Header' => "SecretValue",
             'In-Reply-To' => incoming.message_id
     
    -

    The resulting Mail::Message will have the following in its header:

    +

    The resulting Mail::Message will have the following in its header:

    X-Special-Domain-Specific-Header: SecretValue
     
    @@ -1481,7 +1481,7 @@

    When a :return_path is specified as header, that value will be used as the ‘envelope from’ address for the Mail message. Setting this is useful when you want delivery notifications sent to a different address than the one in :from. Mail will actually use the :return_path in preference to the :sender in preference to the :from field for the ‘envelope from’ value.

    -

    If you do not pass a block to the mail method, it will find all templates in the view paths using by default the mailer name and the method name that it is being called from, it will then create parts for each of these templates intelligently, making educated guesses on correct content type and sequence, and return a fully prepared Mail::Message ready to call :deliver on to send.

    +

    If you do not pass a block to the mail method, it will find all templates in the view paths using by default the mailer name and the method name that it is being called from, it will then create parts for each of these templates intelligently, making educated guesses on correct content type and sequence, and return a fully prepared Mail::Message ready to call :deliver on to send.

    For example:

    diff --git a/src/7.2/classes/ActionMailer/FormBuilder.html b/src/7.2/classes/ActionMailer/FormBuilder.html index af29a5b904..4f8072f7d5 100644 --- a/src/7.2/classes/ActionMailer/FormBuilder.html +++ b/src/7.2/classes/ActionMailer/FormBuilder.html @@ -29,7 +29,7 @@

    Actio

    While emails typically will not include forms, this can be used by views that are shared between controllers and mailers.

    -

    For more information, see ActionController::FormBuilder.

    +

    For more information, see ActionController::FormBuilder.

    diff --git a/src/7.2/classes/ActionMailer/MessageDelivery.html b/src/7.2/classes/ActionMailer/MessageDelivery.html index 6281301ff4..2ec98847e2 100644 --- a/src/7.2/classes/ActionMailer/MessageDelivery.html +++ b/src/7.2/classes/ActionMailer/MessageDelivery.html @@ -31,7 +31,7 @@

    Action Mailer MessageDelivery

    -

    The ActionMailer::MessageDelivery class is used by ActionMailer::Base when creating a new mailer. MessageDelivery is a wrapper (Delegator subclass) around a lazy created Mail::Message. You can get direct access to the Mail::Message, deliver the email or schedule the email to be sent through Active Job.

    +

    The ActionMailer::MessageDelivery class is used by ActionMailer::Base when creating a new mailer. MessageDelivery is a wrapper (Delegator subclass) around a lazy created Mail::Message. You can get direct access to the Mail::Message, deliver the email or schedule the email to be sent through Active Job.

    Notifier.welcome(User.first)               # an ActionMailer::MessageDelivery object
     Notifier.welcome(User.first).deliver_now   # sends the email
    @@ -106,7 +106,7 @@ 

    -

    Enqueues the email to be delivered through Active Job. When the job runs it will send the email using deliver_now.

    +

    Enqueues the email to be delivered through Active Job. When the job runs it will send the email using deliver_now.

    Notifier.welcome(User.first).deliver_later
     Notifier.welcome(User.first).deliver_later(wait: 1.hour)
    @@ -165,7 +165,7 @@ 

    -

    Enqueues the email to be delivered through Active Job. When the job runs it will send the email using deliver_now!. That means that the message will be sent bypassing checking perform_deliveries and raise_delivery_errors, so use with caution.

    +

    Enqueues the email to be delivered through Active Job. When the job runs it will send the email using deliver_now!. That means that the message will be sent bypassing checking perform_deliveries and raise_delivery_errors, so use with caution.

    Notifier.welcome(User.first).deliver_later!
     Notifier.welcome(User.first).deliver_later!(wait: 1.hour)
    diff --git a/src/7.2/classes/ActionText/Attachable.html b/src/7.2/classes/ActionText/Attachable.html
    index 669578f0aa..a81b0efff6 100644
    --- a/src/7.2/classes/ActionText/Attachable.html
    +++ b/src/7.2/classes/ActionText/Attachable.html
    @@ -185,7 +185,7 @@ 

    -

    Extracts the ActionText::Attachable from the attachment HTML node:

    +

    Extracts the ActionText::Attachable from the attachment HTML node:

    person = Person.create! name: "Javan"
     html = %Q(<action-text-attachment sgid="#{person.attachable_sgid}"></action-text-attachment>)
    diff --git a/src/7.2/classes/ActionText/Attribute.html b/src/7.2/classes/ActionText/Attribute.html
    index 54763d6328..5be0c5e723 100644
    --- a/src/7.2/classes/ActionText/Attribute.html
    +++ b/src/7.2/classes/ActionText/Attribute.html
    @@ -97,12 +97,12 @@ 

    Options

    • -

      :encrypted - Pass true to encrypt the rich text attribute. The encryption will be non-deterministic. See ActiveRecord::Encryption::EncryptableRecord.encrypts. Default: false.

      +

      :encrypted - Pass true to encrypt the rich text attribute. The encryption will be non-deterministic. See ActiveRecord::Encryption::EncryptableRecord.encrypts. Default: false.

    • :strict_loading - Pass true to force strict loading. When omitted, strict_loading: will be set to the value of the strict_loading_by_default class attribute (false by default).

    -

    Note: Action Text relies on polymorphic associations, which in turn store class names in the database. When renaming classes that use has_rich_text, make sure to also update the class names in the action_text_rich_texts.record_type polymorphic type column of the corresponding rows.

    +

    Note: Action Text relies on polymorphic associations, which in turn store class names in the database. When renaming classes that use has_rich_text, make sure to also update the class names in the action_text_rich_texts.record_type polymorphic type column of the corresponding rows.

    diff --git a/src/7.2/classes/ActionText/Content.html b/src/7.2/classes/ActionText/Content.html index f60d6ff85e..42665f5329 100644 --- a/src/7.2/classes/ActionText/Content.html +++ b/src/7.2/classes/ActionText/Content.html @@ -31,9 +31,9 @@

    Action Text Content

    -

    The ActionText::Content class wraps an HTML fragment to add support for parsing, rendering and serialization. It can be used to extract links and attachments, convert the fragment to plain text, or serialize the fragment to the database.

    +

    The ActionText::Content class wraps an HTML fragment to add support for parsing, rendering and serialization. It can be used to extract links and attachments, convert the fragment to plain text, or serialize the fragment to the database.

    -

    The ActionText::RichText record serializes the body attribute as ActionText::Content.

    +

    The ActionText::RichText record serializes the body attribute as ActionText::Content.

    class Message < ActiveRecord::Base
       has_rich_text :content
    diff --git a/src/7.2/classes/ActionText/FixtureSet.html b/src/7.2/classes/ActionText/FixtureSet.html
    index 420581752a..aa1f42e14b 100644
    --- a/src/7.2/classes/ActionText/FixtureSet.html
    +++ b/src/7.2/classes/ActionText/FixtureSet.html
    @@ -118,7 +118,7 @@ 

    Examples

    title: Another Article
    -

    You can attach a mention of articles(:first) to second‘s content by embedding a call to ActionText::FixtureSet.attachment in the body: value in test/fixtures/action_text/rich_texts.yml:

    +

    You can attach a mention of articles(:first) to second‘s content by embedding a call to ActionText::FixtureSet.attachment in the body: value in test/fixtures/action_text/rich_texts.yml:

    second:
       record: second (Article)
    diff --git a/src/7.2/classes/ActionText/RichText.html b/src/7.2/classes/ActionText/RichText.html
    index dff62cceec..6ad9072773 100644
    --- a/src/7.2/classes/ActionText/RichText.html
    +++ b/src/7.2/classes/ActionText/RichText.html
    @@ -111,7 +111,7 @@ 

    -

    Returns the ActiveStorage::Blobs of the embedded files.

    +

    Returns the ActiveStorage::Blobs of the embedded files.

    diff --git a/src/7.2/classes/ActionView/Helpers/AssetTagHelper.html b/src/7.2/classes/ActionView/Helpers/AssetTagHelper.html index e8e89638fd..bc09409efb 100644 --- a/src/7.2/classes/ActionView/Helpers/AssetTagHelper.html +++ b/src/7.2/classes/ActionView/Helpers/AssetTagHelper.html @@ -556,7 +556,7 @@

    Options

    When the last parameter is a hash you can add HTML attributes using that parameter. Apart from all the HTML supported options, the following are supported:

    • -

      :image - Hash of options that are passed directly to the image_tag helper.

      +

      :image - Hash of options that are passed directly to the image_tag helper.

    Examples

    @@ -860,7 +860,7 @@

    Options

    When the last parameter is a hash you can add HTML attributes using that parameter. The following options are supported:

    • -

      :poster - Set an image (like a screenshot) to be shown before the video loads. The path is calculated like the src of image_tag.

      +

      :poster - Set an image (like a screenshot) to be shown before the video loads. The path is calculated like the src of image_tag.

    • :size - Supplied as "#{width}x#{height}" or "#{number}", so "30x45" becomes width="30" height="45", and "50" becomes width="50" height="50". :size will be ignored if the value is not in the correct format.

    • diff --git a/src/7.2/classes/ActionView/Helpers/AssetUrlHelper.html b/src/7.2/classes/ActionView/Helpers/AssetUrlHelper.html index af1f59c2ed..c29cdadcf1 100644 --- a/src/7.2/classes/ActionView/Helpers/AssetUrlHelper.html +++ b/src/7.2/classes/ActionView/Helpers/AssetUrlHelper.html @@ -328,7 +328,7 @@

      With the asset pipeline

      -

      All options passed to asset_path will be passed to compute_asset_path which is implemented by asset pipeline gems.

      +

      All options passed to asset_path will be passed to compute_asset_path which is implemented by asset pipeline gems.

      asset_path("application.js") # => "/assets/application-60aa4fdc5cea14baf5400fba1abf4f2a46a5166bad4772b1effe341570f07de9.js"
       asset_path('application.js', host: 'example.com') # => "//example.com/assets/application.js"
      @@ -337,7 +337,7 @@ 

      With the asset pipeli

      Without the asset pipeline (skip_pipeline: true)

      -

      Accepts a type option that can specify the asset’s extension. No error checking is done to verify the source passed into asset_path is valid and that the file exists on disk.

      +

      Accepts a type option that can specify the asset’s extension. No error checking is done to verify the source passed into asset_path is valid and that the file exists on disk.

      asset_path("application.js", skip_pipeline: true)                 # => "application.js"
       asset_path("filedoesnotexist.png", skip_pipeline: true)           # => "filedoesnotexist.png"
      @@ -347,7 +347,7 @@ 

      Options applying to all assets

      -

      Below lists scenarios that apply to asset_path whether or not you’re using the asset pipeline.

      +

      Below lists scenarios that apply to asset_path whether or not you’re using the asset pipeline.

      • All fully qualified URLs are returned immediately. This bypasses the asset pipeline and all other behavior described.

        @@ -449,9 +449,9 @@

        -

        Computes the full URL to an asset in the public directory. This will use asset_path internally, so most of their behaviors will be the same. If :host options is set, it overwrites global config.action_controller.asset_host setting.

        +

        Computes the full URL to an asset in the public directory. This will use asset_path internally, so most of their behaviors will be the same. If :host options is set, it overwrites global config.action_controller.asset_host setting.

        -

        All other options provided are forwarded to asset_path call.

        +

        All other options provided are forwarded to asset_path call.

        asset_url "application.js"                                 # => http://example.com/assets/application.js
         asset_url "application.js", host: "http://cdn.example.com" # => http://cdn.example.com/assets/application.js
        @@ -540,7 +540,7 @@ 

        -

        Computes the full URL to an audio asset in the public audios directory. This will use audio_path internally, so most of their behaviors will be the same. Since audio_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

        +

        Computes the full URL to an audio asset in the public audios directory. This will use audio_path internally, so most of their behaviors will be the same. Since audio_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

        audio_url "horse.wav", host: "http://stage.example.com" # => http://stage.example.com/audios/horse.wav
         
        @@ -774,7 +774,7 @@

        -

        Computes the full URL to a font asset. This will use font_path internally, so most of their behaviors will be the same. Since font_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

        +

        Computes the full URL to a font asset. This will use font_path internally, so most of their behaviors will be the same. Since font_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

        font_url "font.ttf", host: "http://stage.example.com" # => http://stage.example.com/fonts/font.ttf
         
        @@ -825,7 +825,7 @@

        image_path("http://www.example.com/img/edit.png") # => "http://www.example.com/img/edit.png"

        -

        If you have images as application resources this method may conflict with their named routes. The alias path_to_image is provided to avoid that. Rails uses the alias internally, and plugin authors are encouraged to do so.

        +

        If you have images as application resources this method may conflict with their named routes. The alias path_to_image is provided to avoid that. Rails uses the alias internally, and plugin authors are encouraged to do so.

        @@ -864,7 +864,7 @@

        -

        Computes the full URL to an image asset. This will use image_path internally, so most of their behaviors will be the same. Since image_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

        +

        Computes the full URL to an image asset. This will use image_path internally, so most of their behaviors will be the same. Since image_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

        image_url "edit.png", host: "http://stage.example.com" # => http://stage.example.com/assets/edit.png
         
        @@ -952,7 +952,7 @@

        -

        Computes the full URL to a JavaScript asset in the public javascripts directory. This will use javascript_path internally, so most of their behaviors will be the same. Since javascript_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

        +

        Computes the full URL to a JavaScript asset in the public javascripts directory. This will use javascript_path internally, so most of their behaviors will be the same. Since javascript_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

        javascript_url "js/xmlhr.js", host: "http://stage.example.com" # => http://stage.example.com/assets/js/xmlhr.js
         
        @@ -1240,7 +1240,7 @@

        -

        Computes the full URL to a stylesheet asset in the public stylesheets directory. This will use stylesheet_path internally, so most of their behaviors will be the same. Since stylesheet_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

        +

        Computes the full URL to a stylesheet asset in the public stylesheets directory. This will use stylesheet_path internally, so most of their behaviors will be the same. Since stylesheet_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

        stylesheet_url "css/style.css", host: "http://stage.example.com" # => http://stage.example.com/assets/css/style.css
         
        @@ -1503,7 +1503,7 @@

        -

        Computes the full URL to a video asset in the public videos directory. This will use video_path internally, so most of their behaviors will be the same. Since video_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

        +

        Computes the full URL to a video asset in the public videos directory. This will use video_path internally, so most of their behaviors will be the same. Since video_url is based on asset_url method you can set :host options. If :host options is set, it overwrites global config.action_controller.asset_host setting.

        video_url "hd.avi", host: "http://stage.example.com" # => http://stage.example.com/videos/hd.avi
         
        diff --git a/src/7.2/classes/ActionView/Helpers/AtomFeedHelper.html b/src/7.2/classes/ActionView/Helpers/AtomFeedHelper.html index 37570df32b..64bf126f2d 100644 --- a/src/7.2/classes/ActionView/Helpers/AtomFeedHelper.html +++ b/src/7.2/classes/ActionView/Helpers/AtomFeedHelper.html @@ -161,7 +161,7 @@

        end

      -

      atom_feed yields an AtomFeedBuilder instance. Nested elements yield an AtomBuilder instance.

      +

      atom_feed yields an AtomFeedBuilder instance. Nested elements yield an AtomBuilder instance.

    diff --git a/src/7.2/classes/ActionView/Helpers/CacheHelper.html b/src/7.2/classes/ActionView/Helpers/CacheHelper.html index 06d390f09a..7e3caa9298 100644 --- a/src/7.2/classes/ActionView/Helpers/CacheHelper.html +++ b/src/7.2/classes/ActionView/Helpers/CacheHelper.html @@ -453,7 +453,7 @@

    -

    Raises UncacheableFragmentError when called from within a cache block.

    +

    Raises UncacheableFragmentError when called from within a cache block.

    Useful to denote helper methods that can’t participate in fragment caching:

    diff --git a/src/7.2/classes/ActionView/Helpers/CaptureHelper.html b/src/7.2/classes/ActionView/Helpers/CaptureHelper.html index ea945ad593..a73ca54e7d 100644 --- a/src/7.2/classes/ActionView/Helpers/CaptureHelper.html +++ b/src/7.2/classes/ActionView/Helpers/CaptureHelper.html @@ -172,9 +172,9 @@

    -

    Calling content_for stores a block of markup in an identifier for later use. In order to access this stored content in other templates, helper modules or the layout, you would pass the identifier as an argument to content_for.

    +

    Calling content_for stores a block of markup in an identifier for later use. In order to access this stored content in other templates, helper modules or the layout, you would pass the identifier as an argument to content_for.

    -

    Note: yield can still be used to retrieve the stored content, but calling yield doesn’t work in helper modules, while content_for does.

    +

    Note: yield can still be used to retrieve the stored content, but calling yield doesn’t work in helper modules, while content_for does.

    <% content_for :not_authorized do %>
       alert('You are not authorized to do that!')
    @@ -191,7 +191,7 @@ 

    <%= yield :not_authorized if current_user.nil? %>
     
    -

    content_for, however, can also be used in helper modules.

    +

    content_for, however, can also be used in helper modules.

    module StorageHelper
       def stored_content
    @@ -219,7 +219,7 @@ 

    </html>

    -

    And now, we’ll create a view that has a content_for call that creates the script identifier.

    +

    And now, we’ll create a view that has a content_for call that creates the script identifier.

    <%# This is our view %>
     Please login!
    @@ -240,7 +240,7 @@ 

    That will place script tags for your default set of JavaScript files on the page; this technique is useful if you’ll only be using these scripts in a few views.

    -

    Note that content_for concatenates (default) the blocks it is given for a particular identifier in order. For example:

    +

    Note that content_for concatenates (default) the blocks it is given for a particular identifier in order. For example:

    <% content_for :navigation do %>
       <li><%= link_to 'Home', action: 'index' %></li>
    @@ -259,7 +259,7 @@ 

    <ul><%= content_for :navigation %></ul>
     
    -

    If the flush parameter is true content_for replaces the blocks it is given. For example:

    +

    If the flush parameter is true content_for replaces the blocks it is given. For example:

    <% content_for :navigation do %>
       <li><%= link_to 'Home', action: 'index' %></li>
    @@ -282,7 +282,7 @@ 

    <% content_for :script, javascript_include_tag(:defaults) %>
     
    -

    WARNING: content_for is ignored in caches. So you shouldn’t use it for elements that will be fragment cached.

    +

    WARNING: content_for is ignored in caches. So you shouldn’t use it for elements that will be fragment cached.

    @@ -328,7 +328,7 @@

    -

    content_for? checks whether any content has been captured yet using content_for.

    +

    content_for? checks whether any content has been captured yet using content_for.

    Useful to render parts of your layout differently based on what is in your views.

    @@ -378,7 +378,7 @@

    -

    The same as content_for but when used with streaming flushes straight back to the layout. In other words, if you want to concatenate several times to the same buffer when rendering a given template, you should use content_for, if not, use provide to tell the layout to stop looking for more contents.

    +

    The same as content_for but when used with streaming flushes straight back to the layout. In other words, if you want to concatenate several times to the same buffer when rendering a given template, you should use content_for, if not, use provide to tell the layout to stop looking for more contents.

    See ActionController::Streaming for more information.

    diff --git a/src/7.2/classes/ActionView/Helpers/DateHelper.html b/src/7.2/classes/ActionView/Helpers/DateHelper.html index 49f2e9a5f0..dca072dd2f 100644 --- a/src/7.2/classes/ActionView/Helpers/DateHelper.html +++ b/src/7.2/classes/ActionView/Helpers/DateHelper.html @@ -27,11 +27,11 @@

    A

    The Date Helper primarily creates select/option tags for different kinds of dates and times or date and time elements. All of the select-type methods share a number of common options that are as follows:

    • -

      :prefix - overwrites the default prefix of “date” used for the select names. So specifying “birthday” would give birthday[month] instead of date[month] if passed to the select_month method.

      +

      :prefix - overwrites the default prefix of “date” used for the select names. So specifying “birthday” would give birthday[month] instead of date[month] if passed to the select_month method.

    • :include_blank - set to true if it should be possible to set an empty date.

    • -

      :discard_type - set to true if you want to discard the type part of the select name. If set to true, the select_month method would use simply “date” (which can be overwritten using :prefix) instead of date[month].

      +

      :discard_type - set to true if you want to discard the type part of the select name. If set to true, the select_month method would use simply “date” (which can be overwritten using :prefix) instead of date[month].

    @@ -757,7 +757,7 @@

    -

    Returns a select tag with options for each of the hours 0 through 23 with the current hour selected. The datetime can be either a Time or DateTime object or an integer. Override the field name using the :field_name option, ‘hour’ by default.

    +

    Returns a select tag with options for each of the hours 0 through 23 with the current hour selected. The datetime can be either a Time or DateTime object or an integer. Override the field name using the :field_name option, ‘hour’ by default.

    my_time = Time.now + 6.hours
     
    @@ -815,7 +815,7 @@ 

    -

    Returns a select tag with options for each of the minutes 0 through 59 with the current minute selected. Also can return a select tag with options by minute_step from 0 through 59 with the 00 minute selected. The datetime can be either a Time or DateTime object or an integer. Override the field name using the :field_name option, ‘minute’ by default.

    +

    Returns a select tag with options for each of the minutes 0 through 59 with the current minute selected. Also can return a select tag with options by minute_step from 0 through 59 with the 00 minute selected. The datetime can be either a Time or DateTime object or an integer. Override the field name using the :field_name option, ‘minute’ by default.

    my_time = Time.now + 10.minutes
     
    @@ -935,7 +935,7 @@ 

    -

    Returns a select tag with options for each of the seconds 0 through 59 with the current second selected. The datetime can be either a Time or DateTime object or an integer. Override the field name using the :field_name option, ‘second’ by default.

    +

    Returns a select tag with options for each of the seconds 0 through 59 with the current second selected. The datetime can be either a Time or DateTime object or an integer. Override the field name using the :field_name option, ‘second’ by default.

    my_time = Time.now + 16.seconds
     
    @@ -1112,7 +1112,7 @@ 

    -

    Like distance_of_time_in_words, but where to_time is fixed to Time.now.

    +

    Like distance_of_time_in_words, but where to_time is fixed to Time.now.

    time_ago_in_words(3.minutes.from_now)                 # => 3 minutes
     time_ago_in_words(3.minutes.ago)                      # => 3 minutes
    @@ -1127,7 +1127,7 @@ 

    time_ago_in_words(from_time) # => 3 days

    -

    Note that you cannot pass a Numeric value to time_ago_in_words.

    +

    Note that you cannot pass a Numeric value to time_ago_in_words.

    @@ -1168,7 +1168,7 @@

    Returns a set of select tags (one for hour, minute, and optionally second) pre-selected for accessing a specified time-based attribute (identified by method) on an object assigned to the template (identified by object). You can include the seconds with :include_seconds. You can get hours in the AM/PM format with :ampm option.

    -

    This method will also generate 3 input hidden tags, for the actual year, month, and day unless the option :ignore_date is set to true. If you set the :ignore_date to true, you must have a date_select on the same method within the form otherwise an exception will be raised.

    +

    This method will also generate 3 input hidden tags, for the actual year, month, and day unless the option :ignore_date is set to true. If you set the :ignore_date to true, you must have a date_select on the same method within the form otherwise an exception will be raised.

    If anything is passed in the html_options hash it will be applied to every select tag in the set.

    diff --git a/src/7.2/classes/ActionView/Helpers/FormBuilder.html b/src/7.2/classes/ActionView/Helpers/FormBuilder.html index b30e9912b6..700e05a67f 100644 --- a/src/7.2/classes/ActionView/Helpers/FormBuilder.html +++ b/src/7.2/classes/ActionView/Helpers/FormBuilder.html @@ -37,7 +37,7 @@

    Action View Form Builder

    -

    A FormBuilder object is associated with a particular model object and allows you to generate fields associated with the model object. The FormBuilder object is yielded when using form_with or fields_for. For example:

    +

    A FormBuilder object is associated with a particular model object and allows you to generate fields associated with the model object. The FormBuilder object is yielded when using form_with or fields_for. For example:

    <%= form_with model: @person do |person_form| %>
       Name: <%= person_form.text_field :name %>
    @@ -45,9 +45,9 @@ 

    A <% end %>

    -

    In the above block, a FormBuilder object is yielded as the person_form variable. This allows you to generate the text_field and check_box fields by specifying their eponymous methods, which modify the underlying template and associates the @person model object with the form.

    +

    In the above block, a FormBuilder object is yielded as the person_form variable. This allows you to generate the text_field and check_box fields by specifying their eponymous methods, which modify the underlying template and associates the @person model object with the form.

    -

    The FormBuilder object can be thought of as serving as a proxy for the methods in the FormHelper module. This class, however, allows you to call methods with the model object you are building the form for.

    +

    The FormBuilder object can be thought of as serving as a proxy for the methods in the FormHelper module. This class, however, allows you to call methods with the model object you are building the form for.

    You can create your own custom FormBuilder templates by subclassing this class. For example:

    @@ -1006,7 +1006,7 @@

    Generate an HTML id attribute value for the given field

    -

    Return the value generated by the FormBuilder for the given attribute name.

    +

    Return the value generated by the FormBuilder for the given attribute name.

    <%= form_with model: @article do |f| %>
       <%= f.label :title %>
    @@ -1015,7 +1015,7 @@ 

    <% end %>

    -

    In the example above, the <input type="text"> element built by the call to FormBuilder#text_field declares an aria-describedby attribute referencing the <span> element, sharing a common id root (article_title, in this case).

    +

    In the example above, the <input type="text"> element built by the call to FormBuilder#text_field declares an aria-describedby attribute referencing the <span> element, sharing a common id root (article_title, in this case).

    @@ -1052,7 +1052,7 @@

    Generate an HTML name attribute value for the given name and field combination

    -

    Return the value generated by the FormBuilder for the given attribute name.

    +

    Return the value generated by the FormBuilder for the given attribute name.

    <%= form_with model: @article do |f| %>
       <%= f.text_field :title, name: f.field_name(:title, :subtitle) %>
    @@ -1142,7 +1142,7 @@ 

    Creates a scope around a specific model object like form_with, but doesn’t create the form tags themselves. This makes fields_for suitable for specifying additional model objects in the same form.

    -

    Although the usage and purpose of fields_for is similar to form_with‘s, its method signature is slightly different. Like form_with, it yields a FormBuilder object associated with a particular model object to a block, and within the block allows methods to be called on the builder to generate fields associated with the model object. Fields may reflect a model object in two ways - how they are named (hence how submitted values appear within the params hash in the controller) and what default values are shown when the form fields are first displayed. In order for both of these features to be specified independently, both an object name (represented by either a symbol or string) and the object itself can be passed to the method separately -

    +

    Although the usage and purpose of fields_for is similar to form_with‘s, its method signature is slightly different. Like form_with, it yields a FormBuilder object associated with a particular model object to a block, and within the block allows methods to be called on the builder to generate fields associated with the model object. Fields may reflect a model object in two ways - how they are named (hence how submitted values appear within the params hash in the controller) and what default values are shown when the form fields are first displayed. In order for both of these features to be specified independently, both an object name (represented by either a symbol or string) and the object itself can be passed to the method separately -

    <%= form_with model: @person do |person_form| %>
       First name: <%= person_form.text_field :first_name %>
    @@ -1158,7 +1158,7 @@ 

    In this case, the checkbox field will be represented by an HTML input tag with the name attribute permission[admin], and the submitted value will appear in the controller as params[:permission][:admin]. If @person.permission is an existing record with an attribute admin, the initial state of the checkbox when first displayed will reflect the value of @person.permission.admin.

    -

    Often this can be simplified by passing just the name of the model object to fields_for -

    +

    Often this can be simplified by passing just the name of the model object to fields_for -

    <%= fields_for :permission do |permission_fields| %>
       Admin?: <%= permission_fields.check_box :admin %>
    @@ -1167,18 +1167,18 @@ 

    …in which case, if :permission also happens to be the name of an instance variable @permission, the initial state of the input field will reflect the value of that variable’s attribute @permission.admin.

    -

    Alternatively, you can pass just the model object itself (if the first argument isn’t a string or symbol fields_for will realize that the name has been omitted) -

    +

    Alternatively, you can pass just the model object itself (if the first argument isn’t a string or symbol fields_for will realize that the name has been omitted) -

    <%= fields_for @person.permission do |permission_fields| %>
       Admin?: <%= permission_fields.check_box :admin %>
     <% end %>
     
    -

    and fields_for will derive the required name of the field from the class of the model object, e.g. if @person.permission, is of class Permission, the field will still be named permission[admin].

    +

    and fields_for will derive the required name of the field from the class of the model object, e.g. if @person.permission, is of class Permission, the field will still be named permission[admin].

    Note: This also works for the methods in FormOptionsHelper and DateHelper that are designed to work with an object as base, like FormOptionsHelper#collection_select and DateHelper#datetime_select.

    -

    fields_for tries to be smart about parameters, but it can be confused if both name and value parameters are provided and the provided value has the shape of an option Hash. To remove the ambiguity, explicitly pass an option Hash, even if empty.

    +

    fields_for tries to be smart about parameters, but it can be confused if both name and value parameters are provided and the provided value has the shape of an option Hash. To remove the ambiguity, explicitly pass an option Hash, even if empty.

    <%= form_with model: @person do |person_form| %>
       ...
    diff --git a/src/7.2/classes/ActionView/Helpers/FormHelper.html b/src/7.2/classes/ActionView/Helpers/FormHelper.html
    index 95df15954f..d1e9679b7e 100644
    --- a/src/7.2/classes/ActionView/Helpers/FormHelper.html
    +++ b/src/7.2/classes/ActionView/Helpers/FormHelper.html
    @@ -31,9 +31,9 @@ 

    A

    Typically, a form designed to create or update a resource reflects the identity of the resource in several ways: (i) the URL that the form is sent to (the form element’s action attribute) should result in a request being routed to the appropriate controller action (with the appropriate :id parameter in the case of an existing resource), (ii) input fields should be named in such a way that in the controller their values appear in the appropriate places within the params hash, and (iii) for an existing record, when the form is initially displayed, input fields corresponding to attributes of the resource should show the current values of those attributes.

    -

    In Rails, this is usually achieved by creating the form using form_for and a number of related helper methods. form_for generates an appropriate form tag and yields a form builder object that knows the model the form is about. Input fields are created by calling methods defined on the form builder, which means they are able to generate the appropriate names and default values corresponding to the model attributes, as well as convenient IDs, etc. Conventions in the generated field names allow controllers to receive form data nicely structured in params with no effort on your side.

    +

    In Rails, this is usually achieved by creating the form using form_for and a number of related helper methods. form_for generates an appropriate form tag and yields a form builder object that knows the model the form is about. Input fields are created by calling methods defined on the form builder, which means they are able to generate the appropriate names and default values corresponding to the model attributes, as well as convenient IDs, etc. Conventions in the generated field names allow controllers to receive form data nicely structured in params with no effort on your side.

    -

    For example, to create a new person you typically set up a new instance of Person in the PeopleController#new action, @person, and in the view template pass that object to form_for:

    +

    For example, to create a new person you typically set up a new instance of Person in the PeopleController#new action, @person, and in the view template pass that object to form_for:

    <%= form_for @person do |f| %>
       <%= f.label :first_name %>:
    @@ -597,7 +597,7 @@ 

    -

    Scopes input fields with either an explicit scope or model. Like form_with does with :scope or :model, except it doesn’t output the form tags.

    +

    Scopes input fields with either an explicit scope or model. Like form_with does with :scope or :model, except it doesn’t output the form tags.

    # Using a scope prefixes the input field names:
     <%= fields :comment do |fields| %>
    @@ -621,11 +621,11 @@ 

    <% end %>

    -

    Much like form_with a FormBuilder instance associated with the scope or model is yielded, so any generated field names are prefixed with either the passed scope or the scope inferred from the :model.

    +

    Much like form_with a FormBuilder instance associated with the scope or model is yielded, so any generated field names are prefixed with either the passed scope or the scope inferred from the :model.

    Mixing with other form helpers

    -

    While form_with uses a FormBuilder object it’s possible to mix and match the stand-alone FormHelper methods and methods from FormTagHelper:

    +

    While form_with uses a FormBuilder object it’s possible to mix and match the stand-alone FormHelper methods and methods from FormTagHelper:

    <%= fields model: @comment do |fields| %>
       <%= fields.text_field :body %>
    @@ -680,7 +680,7 @@ 

    Creates a scope around a specific model object like form_with, but doesn’t create the form tags themselves. This makes fields_for suitable for specifying additional model objects in the same form.

    -

    Although the usage and purpose of fields_for is similar to form_with‘s, its method signature is slightly different. Like form_with, it yields a FormBuilder object associated with a particular model object to a block, and within the block allows methods to be called on the builder to generate fields associated with the model object. Fields may reflect a model object in two ways - how they are named (hence how submitted values appear within the params hash in the controller) and what default values are shown when the form fields are first displayed. In order for both of these features to be specified independently, both an object name (represented by either a symbol or string) and the object itself can be passed to the method separately -

    +

    Although the usage and purpose of fields_for is similar to form_with‘s, its method signature is slightly different. Like form_with, it yields a FormBuilder object associated with a particular model object to a block, and within the block allows methods to be called on the builder to generate fields associated with the model object. Fields may reflect a model object in two ways - how they are named (hence how submitted values appear within the params hash in the controller) and what default values are shown when the form fields are first displayed. In order for both of these features to be specified independently, both an object name (represented by either a symbol or string) and the object itself can be passed to the method separately -

    <%= form_with model: @person do |person_form| %>
       First name: <%= person_form.text_field :first_name %>
    @@ -696,7 +696,7 @@ 

    In this case, the checkbox field will be represented by an HTML input tag with the name attribute permission[admin], and the submitted value will appear in the controller as params[:permission][:admin]. If @person.permission is an existing record with an attribute admin, the initial state of the checkbox when first displayed will reflect the value of @person.permission.admin.

    -

    Often this can be simplified by passing just the name of the model object to fields_for -

    +

    Often this can be simplified by passing just the name of the model object to fields_for -

    <%= fields_for :permission do |permission_fields| %>
       Admin?: <%= permission_fields.check_box :admin %>
    @@ -705,14 +705,14 @@ 

    …in which case, if :permission also happens to be the name of an instance variable @permission, the initial state of the input field will reflect the value of that variable’s attribute @permission.admin.

    -

    Alternatively, you can pass just the model object itself (if the first argument isn’t a string or symbol fields_for will realize that the name has been omitted) -

    +

    Alternatively, you can pass just the model object itself (if the first argument isn’t a string or symbol fields_for will realize that the name has been omitted) -

    <%= fields_for @person.permission do |permission_fields| %>
       Admin?: <%= permission_fields.check_box :admin %>
     <% end %>
     
    -

    and fields_for will derive the required name of the field from the class of the model object, e.g. if @person.permission, is of class Permission, the field will still be named permission[admin].

    +

    and fields_for will derive the required name of the field from the class of the model object, e.g. if @person.permission, is of class Permission, the field will still be named permission[admin].

    Note: This also works for the methods in FormOptionsHelper and DateHelper that are designed to work with an object as base, like FormOptionsHelper#collection_select and DateHelper#datetime_select.

    @@ -913,7 +913,7 @@

    Returns a file upload input tag tailored for accessing a specified attribute (identified by method) on an object assigned to the template (identified by object). Additional options on the input tag can be passed as a hash with options. These options will be tagged onto the HTML as an HTML element attribute as in the example shown.

    -

    Using this method inside a form_with block will set the enclosing form’s encoding to multipart/form-data.

    +

    Using this method inside a form_with block will set the enclosing form’s encoding to multipart/form-data.

    Options

    • @@ -983,7 +983,7 @@

      Creates a form that allows the user to create or update the attributes of a specific model object.

      -

      The method can be used in several slightly different ways, depending on how much you wish to rely on Rails to infer automatically from the model how the form should be constructed. For a generic model object, a form can be created by passing form_for a string or symbol representing the object we are concerned with:

      +

      The method can be used in several slightly different ways, depending on how much you wish to rely on Rails to infer automatically from the model how the form should be constructed. For a generic model object, a form can be created by passing form_for a string or symbol representing the object we are concerned with:

      <%= form_for :person do |f| %>
         First name: <%= f.text_field :first_name %><br />
      @@ -994,7 +994,7 @@ 

      <% end %>

      -

      The variable f yielded to the block is a FormBuilder object that incorporates the knowledge about the model object represented by :person passed to form_for. Methods defined on the FormBuilder are used to generate fields bound to this model. Thus, for example,

      +

      The variable f yielded to the block is a FormBuilder object that incorporates the knowledge about the model object represented by :person passed to form_for. Methods defined on the FormBuilder are used to generate fields bound to this model. Thus, for example,

      <%= f.text_field :first_name %>
       
      @@ -1008,9 +1008,9 @@

      For fields generated in this way using the FormBuilder, if :person also happens to be the name of an instance variable @person, the default value of the field shown when the form is initially displayed (e.g. in the situation where you are editing an existing record) will be the value of the corresponding attribute of @person.

      -

      The rightmost argument to form_for is an optional hash of options -

      +

      The rightmost argument to form_for is an optional hash of options -

      • -

        :url - The URL the form is to be submitted to. This may be represented in the same way as values passed to url_for or link_to. So for example you may use a named route directly. When the model is represented by a string or symbol, as in the example above, if the :url option is not specified, by default the form will be sent back to the current URL (We will describe below an alternative resource-oriented usage of form_for in which the URL does not need to be specified explicitly).

        +

        :url - The URL the form is to be submitted to. This may be represented in the same way as values passed to url_for or link_to. So for example you may use a named route directly. When the model is represented by a string or symbol, as in the example above, if the :url option is not specified, by default the form will be sent back to the current URL (We will describe below an alternative resource-oriented usage of form_for in which the URL does not need to be specified explicitly).

      • :namespace - A namespace for your form to ensure uniqueness of id attributes on form elements. The namespace attribute will be prefixed with underscore on the generated HTML id.

      • @@ -1025,7 +1025,7 @@

        :html - Optional HTML attributes for the form tag.

      -

      Also note that form_for doesn’t create an exclusive scope. It’s still possible to use both the stand-alone FormHelper methods and methods from FormTagHelper. For example:

      +

      Also note that form_for doesn’t create an exclusive scope. It’s still possible to use both the stand-alone FormHelper methods and methods from FormTagHelper. For example:

      <%= form_for :person do |f| %>
         First name: <%= f.text_field :first_name %>
      @@ -1040,7 +1040,7 @@ 

      form_for with a model object

      -

      In the examples above, the object to be created or edited was represented by a symbol passed to form_for, and we noted that a string can also be used equivalently. It is also possible, however, to pass a model object itself to form_for. For example, if @article is an existing record you wish to edit, you can create the form using

      +

      In the examples above, the object to be created or edited was represented by a symbol passed to form_for, and we noted that a string can also be used equivalently. It is also possible, however, to pass a model object itself to form_for. For example, if @article is an existing record you wish to edit, you can create the form using

      <%= form_for @article do |f| %>
         ...
      @@ -1056,7 +1056,7 @@ 

      form_for, regardless of whether the object is an instance variable. So, for example, if we had a local variable article representing an existing record,

      <%= form_for article do |f| %>
         ...
      @@ -1067,7 +1067,7 @@ 

      Resource-oriented style

      -

      In the examples just shown, although not indicated explicitly, we still need to use the :url option in order to specify where the form is going to be sent. However, further simplification is possible if the record passed to form_for is a resource, i.e. it corresponds to a set of RESTful routes, e.g. defined using the resources method in config/routes.rb. In this case Rails will simply infer the appropriate URL from the record itself. For example,

      +

      In the examples just shown, although not indicated explicitly, we still need to use the :url option in order to specify where the form is going to be sent. However, further simplification is possible if the record passed to form_for is a resource, i.e. it corresponds to a set of RESTful routes, e.g. defined using the resources method in config/routes.rb. In this case Rails will simply infer the appropriate URL from the record itself. For example,

      <%= form_for @article do |f| %>
         ...
      @@ -1130,7 +1130,7 @@ 

      Resource-oriented style <% end %>

      -

      Where @document = Document.find(params[:id]) and @comment = Comment.new.

      +

      Where document = Document.find(params[:id]) and comment = Comment.new.

      Setting the method

      @@ -1371,7 +1371,7 @@

      Resource-oriented style

      -

      In many of the examples just shown, the :model passed to form_with is a resource. It corresponds to a set of RESTful routes, most likely defined via resources in config/routes.rb.

      +

      In many of the examples just shown, the :model passed to form_with is a resource. It corresponds to a set of RESTful routes, most likely defined via resources in config/routes.rb.

      So when passing such a model record, Rails infers the URL and method.

      @@ -1401,7 +1401,7 @@

      Resource-oriented styl <% end %>

      -

      form_with options

      +

      form_with options

      • :url - The URL the form submits to. Akin to values passed to url_for or link_to. For example, you may use a named route directly. When a :scope is passed without a :url the form just submits to the current URL.

      • @@ -1434,7 +1434,7 @@

        form_with optio

        Examples

        -

        When not passing a block, form_with just generates an opening form tag.

        +

        When not passing a block, form_with just generates an opening form tag.

        <%= form_with(model: @article, url: super_articles_path) %>
         <%= form_with(model: @article, scope: :blog) %>
        @@ -1456,11 +1456,11 @@ 

        Examples

        <% end %>
        -

        Where @document = Document.find(params[:id]).

        +

        Where document = Document.find(params[:id]).

        Mixing with other form helpers

        -

        While form_with uses a FormBuilder object it’s possible to mix and match the stand-alone FormHelper methods and methods from FormTagHelper:

        +

        While form_with uses a FormBuilder object it’s possible to mix and match the stand-alone FormHelper methods and methods from FormTagHelper:

        <%= form_with scope: :person do |form| %>
           <%= form.text_field :first_name %>
        @@ -1503,7 +1503,7 @@ 

        Setting HTML options

        Removing hidden model id’s

        -

        The form_with method automatically includes the model id as a hidden field in the form. This is used to maintain the correlation between the form data and its associated model. Some ORM systems do not use IDs on nested models so in this case you want to be able to disable the hidden id.

        +

        The form_with method automatically includes the model id as a hidden field in the form. This is used to maintain the correlation between the form data and its associated model. Some ORM systems do not use IDs on nested models so in this case you want to be able to disable the hidden id.

        In the following example the Article model has many Comments stored within it in a NoSQL database, thus there is no primary key for comments.

        diff --git a/src/7.2/classes/ActionView/Helpers/FormOptionsHelper.html b/src/7.2/classes/ActionView/Helpers/FormOptionsHelper.html index d2ef88d001..6910329e1d 100644 --- a/src/7.2/classes/ActionView/Helpers/FormOptionsHelper.html +++ b/src/7.2/classes/ActionView/Helpers/FormOptionsHelper.html @@ -27,7 +27,7 @@

        collection_select, select and time_zone_select methods take an options parameter, a hash:

        • :include_blank - set to true or a prompt string if the first option element of the select element is a blank. Useful if there is not a default value required for the select element.

          @@ -103,7 +103,7 @@

          collection_select helper, :disabled can also be a Proc that identifies those options that should be disabled.

          collection_select(:post, :category_id, Category.all, :id, :name, { disabled: -> (category) { category.archived? } })
           
          @@ -591,7 +591,7 @@

          -

          Returns a string of <option> tags, like options_for_select, but wraps them with <optgroup> tags:

          +

          Returns a string of <option> tags, like options_for_select, but wraps them with <optgroup> tags:

          grouped_options = [
            ['North America',
          @@ -623,7 +623,7 @@ 

          Parameters:

          • -

            grouped_options - Accepts a nested array or hash of strings. The first value serves as the <optgroup> label while the second value must be an array of options. The second value can be a nested array of text-value pairs. See options_for_select for more info.

            +

            grouped_options - Accepts a nested array or hash of strings. The first value serves as the <optgroup> label while the second value must be an array of options. The second value can be a nested array of text-value pairs. See options_for_select for more info.

            Ex. ["North America",[["United States","US"],["Canada","CA"]]]
             
            @@ -720,7 +720,7 @@

            -

            Returns a string of <option> tags, like options_from_collection_for_select, but groups them by <optgroup> tags based on the object relationships of the arguments.

            +

            Returns a string of <option> tags, like options_from_collection_for_select, but groups them by <optgroup> tags based on the object relationships of the arguments.

            Parameters:

            • @@ -988,9 +988,9 @@

              There are two possible formats for the choices parameter, corresponding to other helpers’ output:

              Example with @post.person_id => 2:

              @@ -1129,7 +1129,7 @@

              Returns select and option tags for the given object and method, using time_zone_options_for_select to generate the list of option tags.

              -

              In addition to the :include_blank option documented above, this method also supports a :model option, which defaults to ActiveSupport::TimeZone. This may be used by users to specify a different time zone model object. (See time_zone_options_for_select for more information.)

              +

              In addition to the :include_blank option documented above, this method also supports a :model option, which defaults to ActiveSupport::TimeZone. This may be used by users to specify a different time zone model object. (See time_zone_options_for_select for more information.)

              You can also supply an array of ActiveSupport::TimeZone objects as priority_zones so that they will be listed above the rest of the (long) list. You can use ActiveSupport::TimeZone.us_zones for a list of US time zones, ActiveSupport::TimeZone.country_zones(country_code) for another country’s time zones, or a Regexp to select the zones of your choice.

              @@ -1231,7 +1231,7 @@

              -

              Returns select and option tags for the given object and method, using weekday_options_for_select to generate the list of option tags.

              +

              Returns select and option tags for the given object and method, using weekday_options_for_select to generate the list of option tags.

              diff --git a/src/7.2/classes/ActionView/Helpers/FormTagHelper.html b/src/7.2/classes/ActionView/Helpers/FormTagHelper.html index 30f3bf7215..83d1f79b82 100644 --- a/src/7.2/classes/ActionView/Helpers/FormTagHelper.html +++ b/src/7.2/classes/ActionView/Helpers/FormTagHelper.html @@ -636,7 +636,7 @@

              Generate an HTML id attribute value for the given name and field combination

              -

              Return the value generated by the FormBuilder for the given attribute name.

              +

              Return the value generated by the FormBuilder for the given attribute name.

              <%= label_tag :post, :title %>
               <%= text_field :post, :title, aria: { describedby: field_id(:post, :title, :error) } %>
              @@ -694,7 +694,7 @@ 

              Generate an HTML name attribute value for the given name and field combination

              -

              Return the value generated by the FormBuilder for the given attribute name.

              +

              Return the value generated by the FormBuilder for the given attribute name.

              <%= text_field :post, :title, name: field_name(:post, :title, :subtitle) %>
               <%# => <input type="text" name="post[title][subtitle]"> %>
              diff --git a/src/7.2/classes/ActionView/Helpers/SanitizeHelper.html b/src/7.2/classes/ActionView/Helpers/SanitizeHelper.html
              index e39f594270..32bf8ce6c4 100644
              --- a/src/7.2/classes/ActionView/Helpers/SanitizeHelper.html
              +++ b/src/7.2/classes/ActionView/Helpers/SanitizeHelper.html
              @@ -97,13 +97,13 @@ 

              Please note that sanitizing user-provided text does not guarantee that the resulting markup is valid or even well-formed.

              Options

              -
              :tags +
              :tags

              An array of allowed tags.

              -
              :attributes +
              :attributes

              An array of allowed attributes.

              -
              :scrubber +
              :scrubber

              A Rails::HTML scrubber or Loofah::Scrubber object that defines custom sanitization rules. A custom scrubber takes precedence over custom tags and attributes.

              diff --git a/src/7.2/classes/ActionView/Helpers/TextHelper.html b/src/7.2/classes/ActionView/Helpers/TextHelper.html index 7fbc4e7c2f..93fb2ee70e 100644 --- a/src/7.2/classes/ActionView/Helpers/TextHelper.html +++ b/src/7.2/classes/ActionView/Helpers/TextHelper.html @@ -29,7 +29,7 @@

              A

              Sanitization

              -

              Most text helpers that generate HTML output sanitize the given input by default, but do not escape it. This means HTML tags will appear in the page but all malicious code will be removed. Let’s look at some examples using the simple_format method:

              +

              Most text helpers that generate HTML output sanitize the given input by default, but do not escape it. This means HTML tags will appear in the page but all malicious code will be removed. Let’s look at some examples using the simple_format method:

              simple_format('<a href="http://example.com/">Example</a>')
               # => "<p><a href=\"http://example.com/\">Example</a></p>"
              @@ -334,13 +334,13 @@ 

              Extracts the first occurrence of phrase plus surrounding text from text. An omission marker is prepended / appended if the start / end of the result does not coincide with the start / end of text. The result is always stripped in any case. Returns nil if phrase isn’t found.

              Options

              -
              :radius +
              :radius

              The number of characters (or tokens — see :separator option) around phrase to include in the result. Defaults to 100.

              -
              :omission +
              :omission

              The marker to prepend / append when the start / end of the excerpt does not coincide with the start / end of text. Defaults to "...".

              -
              :separator +
              :separator

              The separator between tokens to count for :radius. Defaults to "", which treats each character as a token.

              @@ -432,10 +432,10 @@

              If a block is specified, it will be used instead of the highlighter string. Each occurrence of a phrase will be passed to the block, and its return value will be inserted into the final result.

              Options

              -
              :highlighter +
              :highlighter

              The highlighter string. Uses \1 as the placeholder for a phrase, similar to +String#sub+. Defaults to "<mark>\1</mark>". This option is ignored if a block is specified.

              -
              :sanitize +
              :sanitize

              Whether to sanitize text before highlighting. Defaults to true.

              @@ -754,16 +754,16 @@

              The result will be escaped unless escape: false is specified. In any case, the result will be marked HTML-safe. Care should be taken if text might contain HTML tags or entities, because truncation could produce invalid HTML, such as unbalanced or incomplete tags.

              Options

              -
              :length +
              :length

              The maximum number of characters that should be returned, excluding any extra content from the block. Defaults to 30.

              -
              :omission +
              :omission

              The string to append after truncating. Defaults to "...".

              -
              :separator +
              :separator

              A string or regexp used to find a breaking point at which to truncate. By default, truncation can occur at any character in text.

              -
              :escape +
              :escape

              Whether to escape the result. Defaults to true.

              diff --git a/src/7.2/classes/ActionView/Helpers/UrlHelper.html b/src/7.2/classes/ActionView/Helpers/UrlHelper.html index f64ea1568c..096d9c4c5a 100644 --- a/src/7.2/classes/ActionView/Helpers/UrlHelper.html +++ b/src/7.2/classes/ActionView/Helpers/UrlHelper.html @@ -187,7 +187,7 @@

              The form submits a POST request by default if the object is not persisted; conversely, if the object is persisted, it will submit a PATCH request. To specify a different HTTP verb use the :method option within html_options.

              -

              If the HTML button generated from button_to does not work with your layout, you can consider using the link_to method with the data-turbo-method attribute as described in the link_to documentation.

              +

              If the HTML button generated from button_to does not work with your layout, you can consider using the link_to method with the data-turbo-method attribute as described in the link_to documentation.

              Options

              @@ -480,7 +480,7 @@ -

              Because it relies on url_for, link_to supports both older-style controller/action/id arguments and newer RESTful routes. Current Rails style favors RESTful routes whenever possible, so base your application on resources and use

              +

              Because it relies on url_for, link_to supports both older-style controller/action/id arguments and newer RESTful routes. Current Rails style favors RESTful routes whenever possible, so base your application on resources and use

              link_to "Profile", profile_path(@profile)
               # => <a href="/profiles/1">Profile</a>
              @@ -550,7 +550,7 @@ 
               # => <a href="/articles/index/news?class=article">WRONG!</a>
               
              -

              link_to can also produce links with anchors or query strings:

              +

              link_to can also produce links with anchors or query strings:

              link_to "Comment wall", profile_path(@profile, anchor: "wall")
               # => <a href="/profiles/1#wall">Comment wall</a>
              @@ -629,7 +629,7 @@ 
              -

              The implicit block given to link_to_unless_current is evaluated if the current action is the action given. So, if we had a comments page and wanted to render a “Go Back” link instead of a link to the comments page, we could do something like this…

              +

              The implicit block given to link_to_unless_current is evaluated if the current action is the action given. So, if we had a comments page and wanted to render a “Go Back” link instead of a link to the comments page, we could do something like this…

              <%=
                   link_to_unless_current("Comment", { controller: "comments", action: "new" }) do
              @@ -813,7 +813,7 @@ 

              Creates a mailto link tag to the specified email_address, which is also used as the name of the link unless name is specified. Additional HTML attributes for the link can be passed in html_options.

              -

              mail_to has several methods for customizing the email itself by passing special keys to html_options.

              +

              mail_to has several methods for customizing the email itself by passing special keys to html_options.

              Options

              • @@ -830,7 +830,7 @@

                Options

                Obfuscation

                -

                Prior to Rails 4.0, mail_to provided options for encoding the address in order to hinder email harvesters. To take advantage of these options, install the actionview-encoded_mail_to gem.

                +

                Prior to Rails 4.0, mail_to provided options for encoding the address in order to hinder email harvesters. To take advantage of these options, install the actionview-encoded_mail_to gem.

                Examples

                diff --git a/src/7.2/classes/ActionView/Layouts/ClassMethods.html b/src/7.2/classes/ActionView/Layouts/ClassMethods.html index 393a368e9a..7263707a26 100644 --- a/src/7.2/classes/ActionView/Layouts/ClassMethods.html +++ b/src/7.2/classes/ActionView/Layouts/ClassMethods.html @@ -69,27 +69,27 @@

                Specify the layout to use for this class.

                If the specified layout is a:

                -
                String +
                String

                the String is the template name

                -
                Symbol +
                Symbol

                call the method specified by the symbol

                -
                Proc +
                Proc

                call the passed Proc

                -
                false +
                false

                There is no layout

                -
                true +
                true

                raise an ArgumentError

                -
                nil +
                nil

                Force default layout behavior with inheritance

                -

                Return value of Proc and Symbol arguments should be String, false, true, or nil with the same meaning as described above.

                +

                Return value of Proc and Symbol arguments should be String, false, true, or nil with the same meaning as described above.

                Parameters

                • diff --git a/src/7.2/classes/ActionView/Renderer.html b/src/7.2/classes/ActionView/Renderer.html index 019ef6d7d3..1553dfb89d 100644 --- a/src/7.2/classes/ActionView/Renderer.html +++ b/src/7.2/classes/ActionView/Renderer.html @@ -33,7 +33,7 @@

                  Action View Rende

                  This is the main entry point for rendering. It basically delegates to other objects like TemplateRenderer and PartialRenderer which actually renders the template.

                  -

                  The Renderer will parse the options from the render or render_body method and render a partial or a template based on the options. The TemplateRenderer and PartialRenderer objects are wrappers which do all the setup and logic necessary to render a view and a new object is created each time render is called.

                  +

                  The Renderer will parse the options from the render or render_body method and render a partial or a template based on the options. The TemplateRenderer and PartialRenderer objects are wrappers which do all the setup and logic necessary to render a view and a new object is created each time render is called.

              diff --git a/src/7.2/classes/ActionView/RoutingUrlFor.html b/src/7.2/classes/ActionView/RoutingUrlFor.html index adbf3c7c0a..72bed3ed57 100644 --- a/src/7.2/classes/ActionView/RoutingUrlFor.html +++ b/src/7.2/classes/ActionView/RoutingUrlFor.html @@ -66,7 +66,7 @@

              -

              Returns the URL for the set of options provided. This takes the same options as url_for in Action Controller (see the documentation for ActionDispatch::Routing::UrlFor#url_for). Note that by default :only_path is true so you’ll get the relative "/controller/action" instead of the fully qualified URL like "http://example.com/controller/action".

              +

              Returns the URL for the set of options provided. This takes the same options as url_for in Action Controller (see the documentation for ActionDispatch::Routing::UrlFor#url_for). Note that by default :only_path is true so you’ll get the relative "/controller/action" instead of the fully qualified URL like "http://example.com/controller/action".

              Options

              • @@ -87,7 +87,7 @@

                Options

                Relying on named routes

                -

                Passing a record (like an Active Record) instead of a hash as the options parameter will trigger the named route for that record. The lookup will happen on the name of the class. So passing a Workshop object will attempt to use the workshop_path route. If you have a nested route, such as admin_workshop_path you’ll have to call that explicitly (it’s impossible for url_for to guess that route).

                +

                Passing a record (like an Active Record) instead of a hash as the options parameter will trigger the named route for that record. The lookup will happen on the name of the class. So passing a Workshop object will attempt to use the workshop_path route. If you have a nested route, such as admin_workshop_path you’ll have to call that explicitly (it’s impossible for url_for to guess that route).

                Implicit Controller Namespacing

                diff --git a/src/7.2/classes/ActionView/Template.html b/src/7.2/classes/ActionView/Template.html index d21195c63e..326b81a9b4 100644 --- a/src/7.2/classes/ActionView/Template.html +++ b/src/7.2/classes/ActionView/Template.html @@ -472,18 +472,18 @@

                <%= render "application/header", { headline: "Welcome", person: person } %>
                 
                -

                You can use local_assigns in the sub templates to access the local variables:

                +

                You can use local_assigns in the sub templates to access the local variables:

                local_assigns[:headline] # => "Welcome"
                 
                -

                Each key in local_assigns is available as a partial-local variable:

                +

                Each key in local_assigns is available as a partial-local variable:

                local_assigns[:headline] # => "Welcome"
                 headline                 # => "Welcome"
                 
                -

                Since local_assigns is a Hash, it’s compatible with Ruby 3.1’s pattern matching assignment operator:

                +

                Since local_assigns is a Hash, it’s compatible with Ruby 3.1’s pattern matching assignment operator:

                local_assigns => { headline:, **options }
                 headline                 # => "Welcome"
                @@ -504,7 +504,7 @@ 

                <% end %>

                -

                Since local_assigns returns a Hash instance, you can conditionally read a variable, then fall back to a default value when the key isn’t part of the locals: { ... } options:

                +

                Since local_assigns returns a Hash instance, you can conditionally read a variable, then fall back to a default value when the key isn’t part of the locals: { ... } options:

                <% local_assigns.fetch(:alerts, []).each do |alert| %>
                   <p><%= alert %></p>
                @@ -522,7 +522,7 @@ 

                <% end %>

                -

                By default, templates will accept any locals as keyword arguments and make them available to local_assigns. To restrict what local_assigns a template will accept, add a locals: magic comment:

                +

                By default, templates will accept any locals as keyword arguments and make them available to local_assigns. To restrict what local_assigns a template will accept, add a locals: magic comment:

                <%# locals: (headline:, alerts: []) %>
                 
                diff --git a/src/7.2/classes/ActionView/TestCase.html b/src/7.2/classes/ActionView/TestCase.html
                index 2d3ccb0dcc..c96d9c7b2f 100644
                --- a/src/7.2/classes/ActionView/TestCase.html
                +++ b/src/7.2/classes/ActionView/TestCase.html
                @@ -31,7 +31,7 @@ 

                Action View Test Case

                -

                Read more about ActionView::TestCase in Testing Rails Applications in the guides.

                +

                Read more about ActionView::TestCase in Testing Rails Applications in the guides.

              diff --git a/src/7.2/classes/ActionView/TestCase/Behavior.html b/src/7.2/classes/ActionView/TestCase/Behavior.html index d4c8036d10..0bf52c7c1f 100644 --- a/src/7.2/classes/ActionView/TestCase/Behavior.html +++ b/src/7.2/classes/ActionView/TestCase/Behavior.html @@ -300,7 +300,7 @@

              .json

              -

              Parse the rendered content String into JSON. By default, this means a ActiveSupport::HashWithIndifferentAccess.

              +

              Parse the rendered content String into JSON. By default, this means a ActiveSupport::HashWithIndifferentAccess.

              test "renders JSON" do
                 article = Article.create!(title: "Hello, world")
              diff --git a/src/7.2/classes/ActionView/TestCase/Behavior/ClassMethods.html b/src/7.2/classes/ActionView/TestCase/Behavior/ClassMethods.html
              index 1d67fe4314..121932a556 100644
              --- a/src/7.2/classes/ActionView/TestCase/Behavior/ClassMethods.html
              +++ b/src/7.2/classes/ActionView/TestCase/Behavior/ClassMethods.html
              @@ -252,7 +252,7 @@ 

              Register a callable to parse rendered content for a given template format.

              -

              Each registered parser will also define a #rendered.[FORMAT] helper method, where [FORMAT] corresponds to the value of the format argument.

              +

              Each registered parser will also define a rendered.[FORMAT] helper method, where [FORMAT] corresponds to the value of the format argument.

              By default, ActionView::TestCase defines parsers for:

              • @@ -269,10 +269,10 @@

              Parameters

              -
              format +
              format
              -

              The name (as a Symbol) of the format used to render the content.

              -
              callable +

              The name (as a Symbol) of the format used to render the content.

              +
              callable

              The parser. A callable object that accepts the rendered string as its sole argument. Alternatively, the parser can be specified as a block.

              diff --git a/src/7.2/classes/ActiveJob/Enqueuing/ClassMethods.html b/src/7.2/classes/ActiveJob/Enqueuing/ClassMethods.html index a82d8179ab..c212486141 100644 --- a/src/7.2/classes/ActiveJob/Enqueuing/ClassMethods.html +++ b/src/7.2/classes/ActiveJob/Enqueuing/ClassMethods.html @@ -23,7 +23,7 @@

              -

              Includes the perform_later method for job initialization.

              +

              Includes the perform_later method for job initialization.

              diff --git a/src/7.2/classes/ActiveJob/Exceptions/ClassMethods.html b/src/7.2/classes/ActiveJob/Exceptions/ClassMethods.html index 3522297eb4..2fa99bdd28 100644 --- a/src/7.2/classes/ActiveJob/Exceptions/ClassMethods.html +++ b/src/7.2/classes/ActiveJob/Exceptions/ClassMethods.html @@ -125,7 +125,7 @@

              You can also pass a block that’ll be invoked. This block is yielded with the job instance as the first and the error instance as the second parameter.

              -

              retry_on and discard_on handlers are searched from bottom to top, and up the class hierarchy. The handler of the first class for which exception.is_a?(klass) holds true is the one invoked, if any.

              +

              retry_on and discard_on handlers are searched from bottom to top, and up the class hierarchy. The handler of the first class for which exception.is_a?(klass) holds true is the one invoked, if any.

              Example

              @@ -184,7 +184,7 @@

              You can also pass a block that’ll be invoked if the retry attempts fail for custom logic rather than letting the exception bubble up. This block is yielded with the job instance as the first and the error instance as the second parameter.

              -

              retry_on and discard_on handlers are searched from bottom to top, and up the class hierarchy. The handler of the first class for which exception.is_a?(klass) holds true is the one invoked, if any.

              +

              retry_on and discard_on handlers are searched from bottom to top, and up the class hierarchy. The handler of the first class for which exception.is_a?(klass) holds true is the one invoked, if any.

              Options

              • diff --git a/src/7.2/classes/ActiveJob/Execution.html b/src/7.2/classes/ActiveJob/Execution.html index 91edf61a95..ee07ff116b 100644 --- a/src/7.2/classes/ActiveJob/Execution.html +++ b/src/7.2/classes/ActiveJob/Execution.html @@ -140,7 +140,7 @@

                -

                Performs the job immediately. The job is not sent to the queuing adapter but directly executed by blocking the execution of others until it’s finished. perform_now returns the value of your job’s perform method.

                +

                Performs the job immediately. The job is not sent to the queuing adapter but directly executed by blocking the execution of others until it’s finished. perform_now returns the value of your job’s perform method.

                class MyJob < ActiveJob::Base
                   def perform
                diff --git a/src/7.2/classes/ActiveJob/QueueAdapters/QueueClassicAdapter.html b/src/7.2/classes/ActiveJob/QueueAdapters/QueueClassicAdapter.html
                index 6559f6d5dd..f5535ac7dd 100644
                --- a/src/7.2/classes/ActiveJob/QueueAdapters/QueueClassicAdapter.html
                +++ b/src/7.2/classes/ActiveJob/QueueAdapters/QueueClassicAdapter.html
                @@ -131,7 +131,7 @@ 

                Builds a QC::Queue object to schedule jobs on.

                -

                If you have a custom QC::Queue subclass you’ll need to subclass ActiveJob::QueueAdapters::QueueClassicAdapter and override the build_queue method.

                +

                If you have a custom QC::Queue subclass you’ll need to subclass ActiveJob::QueueAdapters::QueueClassicAdapter and override the build_queue method.

                diff --git a/src/7.2/classes/ActiveJob/TestHelper.html b/src/7.2/classes/ActiveJob/TestHelper.html index 65b28e01db..cda88b3343 100644 --- a/src/7.2/classes/ActiveJob/TestHelper.html +++ b/src/7.2/classes/ActiveJob/TestHelper.html @@ -545,7 +545,7 @@

                -

                Asserts that the number of performed jobs matches the given number. If no block is passed, perform_enqueued_jobs must be called around or after the job call.

                +

                Asserts that the number of performed jobs matches the given number. If no block is passed, perform_enqueued_jobs must be called around or after the job call.

                def test_jobs
                   assert_performed_jobs 0
                @@ -871,7 +871,7 @@ 

                If the :at option is specified, then only jobs that have been enqueued to run at or before the given time will be performed. This includes jobs that have been enqueued without a time.

                -

                If queue_adapter_for_test is overridden to return a different adapter, perform_enqueued_jobs will merely execute the block.

                +

                If queue_adapter_for_test is overridden to return a different adapter, perform_enqueued_jobs will merely execute the block.

                diff --git a/src/7.2/classes/ActiveModel.html b/src/7.2/classes/ActiveModel.html index 3060e0ce47..e65a9cc263 100644 --- a/src/7.2/classes/ActiveModel.html +++ b/src/7.2/classes/ActiveModel.html @@ -199,7 +199,7 @@

                Act

                You can read more about Active Model in the Active Model Basics guide.

                -

                Prior to Rails 3.0, if a plugin or gem developer wanted to have an object interact with Action Pack helpers, it was required to either copy chunks of code from Rails, or monkey patch entire helpers to make them handle objects that did not exactly conform to the Active Record interface. This would result in code duplication and fragile applications that broke on upgrades. Active Model solves this by defining an explicit API. You can read more about the API in ActiveModel::Lint::Tests.

                +

                Prior to Rails 3.0, if a plugin or gem developer wanted to have an object interact with Action Pack helpers, it was required to either copy chunks of code from Rails, or monkey patch entire helpers to make them handle objects that did not exactly conform to the Active Record interface. This would result in code duplication and fragile applications that broke on upgrades. Active Model solves this by defining an explicit API. You can read more about the API in ActiveModel::Lint::Tests.

                Active Model provides a default module that implements the basic API required to integrate with Action Pack out of the box: ActiveModel::API.

                diff --git a/src/7.2/classes/ActiveModel/API.html b/src/7.2/classes/ActiveModel/API.html index 5a9b2eefe7..7a158e1abd 100644 --- a/src/7.2/classes/ActiveModel/API.html +++ b/src/7.2/classes/ActiveModel/API.html @@ -39,7 +39,7 @@

                Active Model API

                person.age # => "18"

                -

                Note that, by default, ActiveModel::API implements persisted? to return false, which is the most common case. You may want to override it in your class to simulate a different scenario:

                +

                Note that, by default, ActiveModel::API implements persisted? to return false, which is the most common case. You may want to override it in your class to simulate a different scenario:

                class Person
                   include ActiveModel::API
                @@ -70,7 +70,7 @@ 

                Active Model API

                person.omg # => true
                -

                For more detailed information on other functionalities available, please refer to the specific modules included in ActiveModel::API (see below).

                +

                For more detailed information on other functionalities available, please refer to the specific modules included in ActiveModel::API (see below).

                diff --git a/src/7.2/classes/ActiveModel/AttributeMethods.html b/src/7.2/classes/ActiveModel/AttributeMethods.html index a1e4029e93..d4bb2551ab 100644 --- a/src/7.2/classes/ActiveModel/AttributeMethods.html +++ b/src/7.2/classes/ActiveModel/AttributeMethods.html @@ -33,7 +33,7 @@

                ActiveRecord::Base - like class methods such as table_name.

                -

                The requirements to implement ActiveModel::AttributeMethods are to:

                +

                The requirements to implement ActiveModel::AttributeMethods are to:

                • include ActiveModel::AttributeMethods in your class.

                • @@ -169,7 +169,7 @@

                  -

                  attribute_missing is like method_missing, but for attributes. When method_missing is called we check to see if there is a matching attribute method. If so, we tell attribute_missing to dispatch the attribute. This method can be overloaded to customize the behavior.

                  +

                  attribute_missing is like method_missing, but for attributes. When method_missing is called we check to see if there is a matching attribute method. If so, we tell attribute_missing to dispatch the attribute. This method can be overloaded to customize the behavior.

                  diff --git a/src/7.2/classes/ActiveModel/AttributeMethods/ClassMethods.html b/src/7.2/classes/ActiveModel/AttributeMethods/ClassMethods.html index d67bda6b13..6f101c2149 100644 --- a/src/7.2/classes/ActiveModel/AttributeMethods/ClassMethods.html +++ b/src/7.2/classes/ActiveModel/AttributeMethods/ClassMethods.html @@ -430,9 +430,9 @@

                  -

                  Declares an attribute that should be prefixed and suffixed by ActiveModel::AttributeMethods.

                  +

                  Declares an attribute that should be prefixed and suffixed by ActiveModel::AttributeMethods.

                  -

                  To use, pass an attribute name (as string or symbol). Be sure to declare define_attribute_method after you define any prefix, suffix or affix method, or they will not hook in.

                  +

                  To use, pass an attribute name (as string or symbol). Be sure to declare define_attribute_method after you define any prefix, suffix or affix method, or they will not hook in.

                  class Person
                     include ActiveModel::AttributeMethods
                  @@ -495,9 +495,9 @@ 

                  -

                  Declares the attributes that should be prefixed and suffixed by ActiveModel::AttributeMethods.

                  +

                  Declares the attributes that should be prefixed and suffixed by ActiveModel::AttributeMethods.

                  -

                  To use, pass attribute names (as strings or symbols). Be sure to declare define_attribute_methods after you define any prefix, suffix, or affix methods, or they will not hook in.

                  +

                  To use, pass attribute names (as strings or symbols). Be sure to declare define_attribute_methods after you define any prefix, suffix, or affix methods, or they will not hook in.

                  class Person
                     include ActiveModel::AttributeMethods
                  diff --git a/src/7.2/classes/ActiveModel/Callbacks.html b/src/7.2/classes/ActiveModel/Callbacks.html
                  index e6d8b96da6..7a36841c5c 100644
                  --- a/src/7.2/classes/ActiveModel/Callbacks.html
                  +++ b/src/7.2/classes/ActiveModel/Callbacks.html
                  @@ -29,7 +29,7 @@ 

                  Active Model

                  Like the Active Record methods, the callback chain is aborted as soon as one of the methods throws :abort.

                  -

                  First, extend ActiveModel::Callbacks from the class you are creating:

                  +

                  First, extend ActiveModel::Callbacks from the class you are creating:

                  class MyModel
                     extend ActiveModel::Callbacks
                  @@ -70,7 +70,7 @@ 

                  Active Model end

                  -

                  You can choose to have only specific callbacks by passing a hash to the define_model_callbacks method.

                  +

                  You can choose to have only specific callbacks by passing a hash to the define_model_callbacks method.

                  define_model_callbacks :create, only: [:after, :before]
                   
                  @@ -140,12 +140,12 @@

                  -

                  define_model_callbacks accepts the same options define_callbacks does, in case you want to overwrite a default. Besides that, it also accepts an :only option, where you can choose if you want all types (before, around or after) or just some.

                  +

                  define_model_callbacks accepts the same options define_callbacks does, in case you want to overwrite a default. Besides that, it also accepts an :only option, where you can choose if you want all types (before, around or after) or just some.

                  define_model_callbacks :initialize, only: :after
                   
                  -

                  Note, the only: <type> hash will apply to all callbacks defined on that method call. To get around this you can call the define_model_callbacks method as many times as you need.

                  +

                  Note, the only: <type> hash will apply to all callbacks defined on that method call. To get around this you can call the define_model_callbacks method as many times as you need.

                  define_model_callbacks :create,  only: :after
                   define_model_callbacks :update,  only: :before
                  @@ -170,7 +170,7 @@ 

                  end

                  -

                  NOTE: method_name passed to define_model_callbacks must not end with !, ? or =.

                  +

                  NOTE: method_name passed to define_model_callbacks must not end with !, ? or =.

                  diff --git a/src/7.2/classes/ActiveModel/Dirty.html b/src/7.2/classes/ActiveModel/Dirty.html index 1d30f85a07..2436af7c80 100644 --- a/src/7.2/classes/ActiveModel/Dirty.html +++ b/src/7.2/classes/ActiveModel/Dirty.html @@ -35,11 +35,11 @@

                  Active Model Dirty
                • Call *_will_change! before each change to the tracked attribute.

                • -

                  Call changes_applied after the changes are persisted.

                  +

                  Call changes_applied after the changes are persisted.

                • -

                  Call clear_changes_information when you want to reset the changes information.

                  +

                  Call clear_changes_information when you want to reset the changes information.

                • -

                  Call restore_attributes when you want to restore previous data.

                  +

                  Call restore_attributes when you want to restore previous data.

                A minimal implementation could be:

                @@ -808,7 +808,7 @@

                -

                Clears dirty data and moves changes to previous_changes and mutations_from_database to mutations_before_last_save respectively.

                +

                Clears dirty data and moves changes to previous_changes and mutations_from_database to mutations_before_last_save respectively.

                diff --git a/src/7.2/classes/ActiveModel/EachValidator.html b/src/7.2/classes/ActiveModel/EachValidator.html index 0aab052bd4..03fb083a43 100644 --- a/src/7.2/classes/ActiveModel/EachValidator.html +++ b/src/7.2/classes/ActiveModel/EachValidator.html @@ -31,7 +31,7 @@

                Active Model EachValidator

                -

                EachValidator is a validator which iterates through the attributes given in the options hash invoking the validate_each method passing in the record, attribute, and value.

                +

                EachValidator is a validator which iterates through the attributes given in the options hash invoking the validate_each method passing in the record, attribute, and value.

                All Active Model validations are built on top of this validator.

                @@ -183,7 +183,7 @@

                -

                Performs validation on the supplied record. By default this will call validate_each to determine validity therefore subclasses should override validate_each with validation logic.

                +

                Performs validation on the supplied record. By default this will call validate_each to determine validity therefore subclasses should override validate_each with validation logic.

                diff --git a/src/7.2/classes/ActiveModel/Errors.html b/src/7.2/classes/ActiveModel/Errors.html index 9ec30047c5..428c560352 100644 --- a/src/7.2/classes/ActiveModel/Errors.html +++ b/src/7.2/classes/ActiveModel/Errors.html @@ -66,7 +66,7 @@

                Active Model Errors end

              -

              The last three methods are required in your object for Errors to be able to generate error messages correctly and also handle multiple languages. Of course, if you extend your object with ActiveModel::Translation you will not need to implement the last two. Likewise, using ActiveModel::Validations will handle the validation related methods for you.

              +

              The last three methods are required in your object for Errors to be able to generate error messages correctly and also handle multiple languages. Of course, if you extend your object with ActiveModel::Translation you will not need to implement the last two. Likewise, using ActiveModel::Validations will handle the validation related methods for you.

              The above allows you to do:

              @@ -239,7 +239,7 @@

              Attributes

              [R] errors -

              The actual array of Error objects This method is aliased to objects.

              +

              The actual array of Error objects This method is aliased to objects.

              @@ -247,7 +247,7 @@

              Attributes

              [R] objects -

              The actual array of Error objects This method is aliased to objects.

              +

              The actual array of Error objects This method is aliased to objects.

              @@ -366,7 +366,7 @@

              If type is a string, it will be used as error message.

              -

              If type is a symbol, it will be translated using the appropriate scope (see generate_message).

              +

              If type is a symbol, it will be translated using the appropriate scope (see generate_message).

              person.errors.add(:name, :blank)
               person.errors.messages
              @@ -1355,7 +1355,7 @@ 

              -

              Returns a Hash of attributes with their error messages. If full_messages is true, it will contain full messages (see full_message).

              +

              Returns a Hash of attributes with their error messages. If full_messages is true, it will contain full messages (see full_message).

              person.errors.to_hash       # => {:name=>["cannot be nil"]}
               person.errors.to_hash(true) # => {:name=>["name cannot be nil"]}
              diff --git a/src/7.2/classes/ActiveModel/Lint/Tests.html b/src/7.2/classes/ActiveModel/Lint/Tests.html
              index 370a9a6433..a9cb8a37b8 100644
              --- a/src/7.2/classes/ActiveModel/Lint/Tests.html
              +++ b/src/7.2/classes/ActiveModel/Lint/Tests.html
              @@ -25,7 +25,7 @@ 

              Active Model Lint Tests

              -

              You can test whether an object is compliant with the Active Model API by including ActiveModel::Lint::Tests in your TestCase. It will include tests that tell you whether your object is fully compliant, or if not, which aspects of the API are not implemented.

              +

              You can test whether an object is compliant with the Active Model API by including ActiveModel::Lint::Tests in your TestCase. It will include tests that tell you whether your object is fully compliant, or if not, which aspects of the API are not implemented.

              Note an object is not required to implement all APIs in order to work with Action Pack. This module only intends to provide guidance in case you want all features out of the box.

              diff --git a/src/7.2/classes/ActiveModel/Model.html b/src/7.2/classes/ActiveModel/Model.html index a0d15b874e..3168a7d3cd 100644 --- a/src/7.2/classes/ActiveModel/Model.html +++ b/src/7.2/classes/ActiveModel/Model.html @@ -55,7 +55,7 @@

              Active Model B person.omg # => true

              -

              For more detailed information on other functionalities available, please refer to the specific modules included in ActiveModel::Model (see below).

              +

              For more detailed information on other functionalities available, please refer to the specific modules included in ActiveModel::Model (see below).

              diff --git a/src/7.2/classes/ActiveModel/Name.html b/src/7.2/classes/ActiveModel/Name.html index 3ec54329d4..ee021ebf16 100644 --- a/src/7.2/classes/ActiveModel/Name.html +++ b/src/7.2/classes/ActiveModel/Name.html @@ -376,7 +376,7 @@

              -

              Equivalent to #==.

              +

              Equivalent to ==.

              class BlogPost
                 extend ActiveModel::Naming
              @@ -587,7 +587,7 @@ 

              -

              Equivalent to to_s.

              +

              Equivalent to to_s.

              diff --git a/src/7.2/classes/ActiveModel/Naming.html b/src/7.2/classes/ActiveModel/Naming.html index 85b74eabb4..7dd19c074d 100644 --- a/src/7.2/classes/ActiveModel/Naming.html +++ b/src/7.2/classes/ActiveModel/Naming.html @@ -25,7 +25,7 @@

              Active Model Naming

              -

              Creates a model_name method on your object.

              +

              Creates a model_name method on your object.

              To implement, just extend ActiveModel::Naming in your object:

              diff --git a/src/7.2/classes/ActiveModel/SecurePassword/ClassMethods.html b/src/7.2/classes/ActiveModel/SecurePassword/ClassMethods.html index 2f785e37da..9680d35d5c 100644 --- a/src/7.2/classes/ActiveModel/SecurePassword/ClassMethods.html +++ b/src/7.2/classes/ActiveModel/SecurePassword/ClassMethods.html @@ -97,7 +97,7 @@

              All of the above validations can be omitted by passing validations: false as an argument. This allows complete customizability of validation behavior.

              -

              To use has_secure_password, add bcrypt (~> 3.1.7) to your Gemfile:

              +

              To use has_secure_password, add bcrypt (~> 3.1.7) to your Gemfile:

              gem "bcrypt", "~> 3.1.7"
               
              diff --git a/src/7.2/classes/ActiveModel/Serialization.html b/src/7.2/classes/ActiveModel/Serialization.html index e0c7bc7b14..247080310a 100644 --- a/src/7.2/classes/ActiveModel/Serialization.html +++ b/src/7.2/classes/ActiveModel/Serialization.html @@ -50,7 +50,7 @@

              Acti

              An attributes hash must be defined and should contain any attributes you need to be serialized. Attributes must be strings, not symbols. When called, serializable hash will use instance methods that match the name of the attributes hash’s keys. In order to override this behavior, take a look at the private method read_attribute_for_serialization.

              -

              ActiveModel::Serializers::JSON module automatically includes the ActiveModel::Serialization module, so there is no need to explicitly include ActiveModel::Serialization.

              +

              ActiveModel::Serializers::JSON module automatically includes the ActiveModel::Serialization module, so there is no need to explicitly include ActiveModel::Serialization.

              A minimal implementation including JSON would be:

              diff --git a/src/7.2/classes/ActiveModel/Serializers/JSON.html b/src/7.2/classes/ActiveModel/Serializers/JSON.html index d60f82535f..d7ce68c09e 100644 --- a/src/7.2/classes/ActiveModel/Serializers/JSON.html +++ b/src/7.2/classes/ActiveModel/Serializers/JSON.html @@ -92,7 +92,7 @@

              Returns a hash representing the model. Some configuration can be passed through options.

              -

              The option include_root_in_json controls the top-level behavior of as_json. If true, as_json will emit a single root node named after the object’s type. The default value for include_root_in_json option is false.

              +

              The option include_root_in_json controls the top-level behavior of as_json. If true, as_json will emit a single root node named after the object’s type. The default value for include_root_in_json option is false.

              user = User.find(1)
               user.as_json
              diff --git a/src/7.2/classes/ActiveModel/Translation.html b/src/7.2/classes/ActiveModel/Translation.html
              index cc4b2dcd44..8f745e0f5f 100644
              --- a/src/7.2/classes/ActiveModel/Translation.html
              +++ b/src/7.2/classes/ActiveModel/Translation.html
              @@ -37,7 +37,7 @@ 

              Active M # => "My attribute"

              -

              This also provides the required class methods for hooking into the Rails internationalization API, including being able to define a class-based i18n_scope and lookup_ancestors to find translations in parent classes.

              +

              This also provides the required class methods for hooking into the Rails internationalization API, including being able to define a class-based i18n_scope and lookup_ancestors to find translations in parent classes.

              @@ -170,7 +170,7 @@

              -

              Returns the i18n_scope for the class. Override if you want custom lookup.

              +

              Returns the i18n_scope for the class. Override if you want custom lookup.

              diff --git a/src/7.2/classes/ActiveModel/Type/Boolean.html b/src/7.2/classes/ActiveModel/Type/Boolean.html index 60aba12768..3bbb4c9c58 100644 --- a/src/7.2/classes/ActiveModel/Type/Boolean.html +++ b/src/7.2/classes/ActiveModel/Type/Boolean.html @@ -35,7 +35,7 @@

              Activ

              A class that behaves like a boolean type, including rules for coercion of user input.

              • -

                "false", "f", "0", 0 or any other value in FALSE_VALUES will be coerced to false.

                +

                "false", "f", "0", 0 or any other value in FALSE_VALUES will be coerced to false.

              • Empty strings are coerced to nil.

              • diff --git a/src/7.2/classes/ActiveModel/Type/Value.html b/src/7.2/classes/ActiveModel/Type/Value.html index b85e01c114..047f4db8b9 100644 --- a/src/7.2/classes/ActiveModel/Type/Value.html +++ b/src/7.2/classes/ActiveModel/Type/Value.html @@ -581,7 +581,7 @@

                -

                Casts a value from the ruby type to a type that the database knows how to understand. The returned value from this method should be a String, Numeric, Date, Time, Symbol, true, false, or nil.

                +

                Casts a value from the ruby type to a type that the database knows how to understand. The returned value from this method should be a String, Numeric, Date, Time, Symbol, true, false, or nil.

                diff --git a/src/7.2/classes/ActiveModel/Validations.html b/src/7.2/classes/ActiveModel/Validations.html index 25c93b975b..09b9c6a0ba 100644 --- a/src/7.2/classes/ActiveModel/Validations.html +++ b/src/7.2/classes/ActiveModel/Validations.html @@ -86,7 +86,7 @@

                Active M person.errors.messages # => {first_name:["starts with z."]}

              -

              Note that ActiveModel::Validations automatically adds an errors method to your instances initialized with a new ActiveModel::Errors object, so there is no need for you to do this manually.

              +

              Note that ActiveModel::Validations automatically adds an errors method to your instances initialized with a new ActiveModel::Errors object, so there is no need for you to do this manually.

              @@ -215,7 +215,7 @@

              -

              Returns the Errors object that holds all information about attribute error messages.

              +

              Returns the Errors object that holds all information about attribute error messages.

              class Person
                 include ActiveModel::Validations
              @@ -421,7 +421,7 @@ 

              -

              Runs all the validations within the specified context. Returns true if no errors are found, raises ValidationError otherwise.

              +

              Runs all the validations within the specified context. Returns true if no errors are found, raises ValidationError otherwise.

              Validations with no :on option will run no matter the context. Validations with some :on option will only run in the specified context.

              @@ -486,7 +486,7 @@

              end

              -

              Standard configuration options (:on, :if and :unless), which are available on the class version of validates_with, should instead be placed on the validates method as these are applied and tested in the callback.

              +

              Standard configuration options (:on, :if and :unless), which are available on the class version of validates_with, should instead be placed on the validates method as these are applied and tested in the callback.

              If you pass any additional configuration options, they will be passed to the class and available as options, please refer to the class version of this method for more information.

              diff --git a/src/7.2/classes/ActiveModel/Validations/Callbacks.html b/src/7.2/classes/ActiveModel/Validations/Callbacks.html index 84d589df05..cd37004938 100644 --- a/src/7.2/classes/ActiveModel/Validations/Callbacks.html +++ b/src/7.2/classes/ActiveModel/Validations/Callbacks.html @@ -27,7 +27,7 @@

              ClassMethods#before_validation and ClassMethods#after_validation callbacks.

              -

              First, include ActiveModel::Validations::Callbacks from the class you are creating:

              +

              First, include ActiveModel::Validations::Callbacks from the class you are creating:

              class MyModel
                 include ActiveModel::Validations::Callbacks
              diff --git a/src/7.2/classes/ActiveModel/Validations/ClassMethods.html b/src/7.2/classes/ActiveModel/Validations/ClassMethods.html
              index ed0af7831f..0e8517c89c 100644
              --- a/src/7.2/classes/ActiveModel/Validations/ClassMethods.html
              +++ b/src/7.2/classes/ActiveModel/Validations/ClassMethods.html
              @@ -149,7 +149,7 @@ 

              Clears all of the validators and validations.

              -

              Note that this will clear anything that is being used to validate the model for both the validates_with and validate methods. It clears the validators that are created with an invocation of validates_with and the callbacks that are set by an invocation of validate.

              +

              Note that this will clear anything that is being used to validate the model for both the validates_with and validate methods. It clears the validators that are created with an invocation of validates_with and the callbacks that are set by an invocation of validate.

              class Person
                 include ActiveModel::Validations
              @@ -596,7 +596,7 @@ 

              end

              -

              There is no default error message for validates_with. You must manually add errors to the record’s errors collection in the validator class.

              +

              There is no default error message for validates_with. You must manually add errors to the record’s errors collection in the validator class.

              To implement the validate method, you must have a record parameter defined, which is the record to be validated.

              @@ -673,7 +673,7 @@

              -

              List all validators that are being used to validate the model using validates_with method.

              +

              List all validators that are being used to validate the model using validates_with method.

              class Person
                 include ActiveModel::Validations
              diff --git a/src/7.2/classes/ActiveModel/Validations/HelperMethods.html b/src/7.2/classes/ActiveModel/Validations/HelperMethods.html
              index 4c7ccfd95b..2459f6e4c9 100644
              --- a/src/7.2/classes/ActiveModel/Validations/HelperMethods.html
              +++ b/src/7.2/classes/ActiveModel/Validations/HelperMethods.html
              @@ -644,7 +644,7 @@ 

              -

              Validates whether the value of the specified attribute is numeric by trying to convert it to a float with Kernel.Float (if only_integer is false) or applying it to the regular expression /\A[+\-]?\d+\z/ (if only_integer is set to true). Precision of Kernel.Float values are guaranteed up to 15 digits.

              +

              Validates whether the value of the specified attribute is numeric by trying to convert it to a float with Kernel.Float (if only_integer is false) or applying it to the regular expression /\A[+\-]?\d+\z/ (if only_integer is set to true). Precision of Kernel.Float values are guaranteed up to 15 digits.

              class Person < ActiveRecord::Base
                 validates_numericality_of :value, on: :create
              diff --git a/src/7.2/classes/ActiveRecord.html b/src/7.2/classes/ActiveRecord.html
              index b328117963..bcb990a027 100644
              --- a/src/7.2/classes/ActiveRecord.html
              +++ b/src/7.2/classes/ActiveRecord.html
              @@ -2748,7 +2748,7 @@ 

              -

              Specify whether or not to validate migration timestamps. When set, an error will be raised if a timestamp is more than a day ahead of the timestamp associated with the current time. timestamped_migrations must be set to true.

              +

              Specify whether or not to validate migration timestamps. When set, an error will be raised if a timestamp is more than a day ahead of the timestamp associated with the current time. timestamped_migrations must be set to true.

              diff --git a/src/7.2/classes/ActiveRecord/Associations/ClassMethods.html b/src/7.2/classes/ActiveRecord/Associations/ClassMethods.html index b2d74c48a4..3d6f765f63 100644 --- a/src/7.2/classes/ActiveRecord/Associations/ClassMethods.html +++ b/src/7.2/classes/ActiveRecord/Associations/ClassMethods.html @@ -66,7 +66,7 @@

              A word of warning

              -

              Don’t create associations that have the same name as instance methods of ActiveRecord::Base. Since the association adds a method with that name to its model, using an association with the same name as one provided by ActiveRecord::Base will override the method inherited through ActiveRecord::Base and will break things. For instance, attributes and connection would be bad choices for association names, because those names already exist in the list of ActiveRecord::Base instance methods.

              +

              Don’t create associations that have the same name as instance methods of ActiveRecord::Base. Since the association adds a method with that name to its model, using an association with the same name as one provided by ActiveRecord::Base will override the method inherited through ActiveRecord::Base and will break things. For instance, attributes and connection would be bad choices for association names, because those names already exist in the list of ActiveRecord::Base instance methods.

              Auto-generated methods

              @@ -239,7 +239,7 @@

              ActiveRecord::RecordNotSaved exception is raised and the assignment is cancelled.

            • -

              If you wish to assign an object to a has_one association without saving it, use the #build_association method (documented below). The object being replaced will still be saved to update its foreign key.

              +

              If you wish to assign an object to a has_one association without saving it, use the build_association method (documented below). The object being replaced will still be saved to update its foreign key.

            • Assigning an object to a belongs_to association does not save the object, since the foreign key field belongs on the parent. It does not save the parent either.

            @@ -259,7 +259,7 @@

            Colle

            Customizing the query

            -

            Associations are built from Relation objects, and you can use the Relation syntax to customize them. For example, to add a condition:

            +

            Associations are built from Relation objects, and you can use the Relation syntax to customize them. For example, to add a condition:

            class Blog < ActiveRecord::Base
               has_many :published_posts, -> { where(published: true) }, class_name: 'Post'
            @@ -899,31 +899,31 @@ 

            Methods will be added for retrieval and query for a single associated object, for which this object holds an id:

            association is a placeholder for the symbol passed as the name argument, so belongs_to :author would add among others author.nil?.

            -
            association +
            association

            Returns the associated object. nil is returned if none is found.

            -
            association=(associate) +
            association=(associate)

            Assigns the associate object, extracts the primary key, and sets it as the foreign key. No modification or deletion of existing records takes place.

            -
            build_association(attributes = {}) +
            build_association(attributes = {})

            Returns a new object of the associated type that has been instantiated with attributes and linked to this object through a foreign key, but has not yet been saved.

            -
            create_association(attributes = {}) +
            create_association(attributes = {})

            Returns a new object of the associated type that has been instantiated with attributes, linked to this object through a foreign key, and that has already been saved (if it passed the validation).

            -
            create_association!(attributes = {}) +
            create_association!(attributes = {})

            Does the same as create_association, but raises ActiveRecord::RecordInvalid if the record is invalid.

            -
            reload_association +
            reload_association

            Returns the associated object, forcing a database read.

            -
            reset_association +
            reset_association

            Unloads the associated object. The next access will query it from the database.

            -
            association_changed? +
            association_changed?

            Returns true if a new associate object has been assigned and the next save will update the foreign key.

            -
            association_previously_changed? +
            association_previously_changed?

            Returns true if the previous save updated the association to reference a new associate object.

            @@ -965,63 +965,63 @@

            Scopes

            Options

            The declaration can also include an options hash to specialize the behavior of the association.

            -
            :class_name +
            :class_name

            Specify the class name of the association. Use it only if that name can’t be inferred from the association name. So belongs_to :author will by default be linked to the Author class, but if the real class name is Person, you’ll have to specify it with this option.

            -
            :foreign_key +
            :foreign_key

            Specify the foreign key used for the association. By default this is guessed to be the name of the association with an “_id” suffix. So a class that defines a belongs_to :person association will use “person_id” as the default :foreign_key. Similarly, belongs_to :favorite_person, class_name: "Person" will use a foreign key of “favorite_person_id”.

            Setting the :foreign_key option prevents automatic detection of the association’s inverse, so it is generally a good idea to set the :inverse_of option as well.

            -
            :foreign_type +
            :foreign_type

            Specify the column used to store the associated object’s type, if this is a polymorphic association. By default this is guessed to be the name of the association with a “_type” suffix. So a class that defines a belongs_to :taggable, polymorphic: true association will use “taggable_type” as the default :foreign_type.

            -
            :primary_key +
            :primary_key

            Specify the method that returns the primary key of associated object used for the association. By default this is id.

            -
            :dependent +
            :dependent

            If set to :destroy, the associated object is destroyed when this object is. If set to :delete, the associated object is deleted without calling its destroy method. If set to :destroy_async, the associated object is scheduled to be destroyed in a background job. This option should not be specified when belongs_to is used in conjunction with a has_many relationship on another class because of the potential to leave orphaned records behind.

            -
            :counter_cache +
            :counter_cache

            Caches the number of belonging objects on the associate class through the use of CounterCache::ClassMethods#increment_counter and CounterCache::ClassMethods#decrement_counter. The counter cache is incremented when an object of this class is created and decremented when it’s destroyed. This requires that a column named #{table_name}_count (such as comments_count for a belonging Comment class) is used on the associate class (such as a Post class) - that is the migration for #{table_name}_count is created on the associate class (such that Post.comments_count will return the count cached). You can also specify a custom counter cache column by providing a column name instead of a true/false value to this option (e.g., counter_cache: :my_custom_counter.)

            Starting to use counter caches on existing large tables can be troublesome, because the column values must be backfilled separately of the column addition (to not lock the table for too long) and before the use of :counter_cache (otherwise methods like size/any?/etc, which use counter caches internally, can produce incorrect results). To safely backfill the values while keeping counter cache columns updated with the child records creation/removal and to avoid the mentioned methods use the possibly incorrect counter cache column values and always get the results from the database, use counter_cache: { active: false }. If you also need to specify a custom column name, use counter_cache: { active: false, column: :my_custom_counter }.

            Note: If you’ve enabled the counter cache, then you may want to add the counter cache attribute to the attr_readonly list in the associated classes (e.g. class Post; attr_readonly :comments_count; end).

            -
            :polymorphic +
            :polymorphic

            Specify this association is a polymorphic association by passing true. Note: Since polymorphic associations rely on storing class names in the database, make sure to update the class names in the *_type polymorphic type column of the corresponding rows.

            -
            :validate +
            :validate

            When set to true, validates new objects added to association when saving the parent object. false by default. If you want to ensure associated objects are revalidated on every update, use validates_associated.

            -
            :autosave +
            :autosave

            If true, always save the associated object or destroy it if marked for destruction, when saving the parent object. If false, never save or destroy the associated object. By default, only save the associated object if it’s a new record.

            Note that NestedAttributes::ClassMethods#accepts_nested_attributes_for sets :autosave to true.

            -
            :touch +
            :touch

            If true, the associated object will be touched (the updated_at / updated_on attributes set to current time) when this record is either saved or destroyed. If you specify a symbol, that attribute will be updated with the current time in addition to the updated_at / updated_on attribute. Please note that no validation will be performed when touching, and only the after_touch, after_commit, and after_rollback callbacks will be executed.

            -
            :inverse_of +
            :inverse_of

            Specifies the name of the has_one or has_many association on the associated object that is the inverse of this belongs_to association. See Bi-directional associations for more detail.

            -
            :optional +
            :optional

            When set to true, the association will not have its presence validated.

            -
            :required +
            :required

            When set to true, the association will also have its presence validated. This will validate the association itself, not the id. You can use :inverse_of to avoid an extra query during validation. NOTE: required is set to true by default and is deprecated. If you don’t want to have association presence validated, use optional: true.

            -
            :default +
            :default

            Provide a callable (i.e. proc or lambda) to specify that the association should be initialized with a particular record before validation. Please note that callable won’t be executed if the record exists.

            -
            :strict_loading +
            :strict_loading

            Enforces strict loading every time the associated record is loaded through this association.

            -
            :ensuring_owner_was +
            :ensuring_owner_was

            Specifies an instance method to be called on the owner. The method must return true in order for the associated records to be deleted in a background job.

            -
            :query_constraints +
            :query_constraints

            Serves as a composite foreign key. Defines the list of columns to be used to query the associated object. This is an optional option. By default Rails will attempt to derive the value automatically. When the value is set the Array size must match associated model’s primary key or query_constraints size.

            @@ -1094,49 +1094,49 @@

            Adds the following methods for retrieval and query:

            collection is a placeholder for the symbol passed as the name argument, so has_and_belongs_to_many :categories would add among others categories.empty?.

            -
            collection +
            collection

            Returns a Relation of all the associated objects. An empty Relation is returned if none are found.

            -
            collection<<(object, ...) +
            collection<<(object, ...)

            Adds one or more objects to the collection by creating associations in the join table (collection.push and collection.concat are aliases to this method). Note that this operation instantly fires update SQL without waiting for the save or update call on the parent object, unless the parent object is a new record.

            -
            collection.delete(object, ...) +
            collection.delete(object, ...)

            Removes one or more objects from the collection by removing their associations from the join table. This does not destroy the objects.

            -
            collection.destroy(object, ...) +
            collection.destroy(object, ...)

            Removes one or more objects from the collection by running destroy on each association in the join table, overriding any dependent option. This does not destroy the objects.

            -
            collection=objects +
            collection=objects

            Replaces the collection’s content by deleting and adding objects as appropriate.

            -
            collection_singular_ids +
            collection_singular_ids

            Returns an array of the associated objects’ ids.

            -
            collection_singular_ids=ids +
            collection_singular_ids=ids

            Replace the collection by the objects identified by the primary keys in ids.

            -
            collection.clear +
            collection.clear

            Removes every object from the collection. This does not destroy the objects.

            -
            collection.empty? +
            collection.empty?

            Returns true if there are no associated objects.

            -
            collection.size +
            collection.size

            Returns the number of associated objects.

            -
            collection.find(id) +
            collection.find(id)

            Finds an associated object responding to the id and that meets the condition that it has to be associated with this object. Uses the same rules as ActiveRecord::FinderMethods#find.

            -
            collection.exists?(...) +
            collection.exists?(...)

            Checks whether an associated object with the given conditions exists. Uses the same rules as ActiveRecord::FinderMethods#exists?.

            -
            collection.build(attributes = {}) +
            collection.build(attributes = {})

            Returns a new object of the collection type that has been instantiated with attributes and linked to this object through the join table, but has not yet been saved.

            -
            collection.create(attributes = {}) +
            collection.create(attributes = {})

            Returns a new object of the collection type that has been instantiated with attributes, linked to this object through the join table, and that has already been saved (if it passed the validation).

            -
            collection.reload +
            collection.reload

            Returns a Relation of all of the associated objects, forcing a database read. An empty Relation is returned if none are found.

            @@ -1199,29 +1199,29 @@

            Extensions

            Options

            -
            :class_name +
            :class_name

            Specify the class name of the association. Use it only if that name can’t be inferred from the association name. So has_and_belongs_to_many :projects will by default be linked to the Project class, but if the real class name is SuperProject, you’ll have to specify it with this option.

            -
            :join_table +
            :join_table

            Specify the name of the join table if the default based on lexical order isn’t what you want. WARNING: If you’re overwriting the table name of either class, the table_name method MUST be declared underneath any has_and_belongs_to_many declaration in order to work.

            -
            :foreign_key +
            :foreign_key

            Specify the foreign key used for the association. By default this is guessed to be the name of this class in lower-case and “_id” suffixed. So a Person class that makes a has_and_belongs_to_many association to Project will use “person_id” as the default :foreign_key.

            Setting the :foreign_key option prevents automatic detection of the association’s inverse, so it is generally a good idea to set the :inverse_of option as well.

            -
            :association_foreign_key +
            :association_foreign_key

            Specify the foreign key used for the association on the receiving side of the association. By default this is guessed to be the name of the associated class in lower-case and “_id” suffixed. So if a Person class makes a has_and_belongs_to_many association to Project, the association will use “project_id” as the default :association_foreign_key.

            -
            :validate +
            :validate

            When set to true, validates new objects added to association when saving the parent object. true by default. If you want to ensure associated objects are revalidated on every update, use validates_associated.

            -
            :autosave +
            :autosave

            If true, always save the associated objects or destroy them if marked for destruction, when saving the parent object. If false, never save or destroy the associated objects. By default, only save associated objects that are new records.

            Note that NestedAttributes::ClassMethods#accepts_nested_attributes_for sets :autosave to true.

            -
            :strict_loading +
            :strict_loading

            Enforces strict loading every time an associated record is loaded through this association.

            @@ -1306,56 +1306,56 @@

            Specifies a one-to-many association. The following methods for retrieval and query of collections of associated objects will be added:

            collection is a placeholder for the symbol passed as the name argument, so has_many :clients would add among others clients.empty?.

            -
            collection +
            collection

            Returns a Relation of all the associated objects. An empty Relation is returned if none are found.

            -
            collection<<(object, ...) +
            collection<<(object, ...)

            Adds one or more objects to the collection by setting their foreign keys to the collection’s primary key. Note that this operation instantly fires update SQL without waiting for the save or update call on the parent object, unless the parent object is a new record. This will also run validations and callbacks of associated object(s).

            -
            collection.delete(object, ...) +
            collection.delete(object, ...)

            Removes one or more objects from the collection by setting their foreign keys to NULL. Objects will be in addition destroyed if they’re associated with dependent: :destroy, and deleted if they’re associated with dependent: :delete_all.

            If the :through option is used, then the join records are deleted (rather than nullified) by default, but you can specify dependent: :destroy or dependent: :nullify to override this.

            -
            collection.destroy(object, ...) +
            collection.destroy(object, ...)

            Removes one or more objects from the collection by running destroy on each record, regardless of any dependent option, ensuring callbacks are run.

            If the :through option is used, then the join records are destroyed instead, not the objects themselves.

            -
            collection=objects +
            collection=objects

            Replaces the collections content by deleting and adding objects as appropriate. If the :through option is true callbacks in the join models are triggered except destroy callbacks, since deletion is direct by default. You can specify dependent: :destroy or dependent: :nullify to override this.

            -
            collection_singular_ids +
            collection_singular_ids

            Returns an array of the associated objects’ ids

            -
            collection_singular_ids=ids +
            collection_singular_ids=ids

            Replace the collection with the objects identified by the primary keys in ids. This method loads the models and calls collection=. See above.

            -
            collection.clear +
            collection.clear

            Removes every object from the collection. This destroys the associated objects if they are associated with dependent: :destroy, deletes them directly from the database if dependent: :delete_all, otherwise sets their foreign keys to NULL. If the :through option is true no destroy callbacks are invoked on the join models. Join models are directly deleted.

            -
            collection.empty? +
            collection.empty?

            Returns true if there are no associated objects.

            -
            collection.size +
            collection.size

            Returns the number of associated objects.

            -
            collection.find(...) +
            collection.find(...)

            Finds an associated object according to the same rules as ActiveRecord::FinderMethods#find.

            -
            collection.exists?(...) +
            collection.exists?(...)

            Checks whether an associated object with the given conditions exists. Uses the same rules as ActiveRecord::FinderMethods#exists?.

            -
            collection.build(attributes = {}, ...) +
            collection.build(attributes = {}, ...)

            Returns one or more new objects of the collection type that have been instantiated with attributes and linked to this object through a foreign key, but have not yet been saved.

            -
            collection.create(attributes = {}) +
            collection.create(attributes = {})

            Returns a new object of the collection type that has been instantiated with attributes, linked to this object through a foreign key, and that has already been saved (if it passed the validation). Note: This only works if the base model already exists in the DB, not if it is a new (unsaved) record!

            -
            collection.create!(attributes = {}) +
            collection.create!(attributes = {})

            Does the same as collection.create, but raises ActiveRecord::RecordInvalid if the record is invalid.

            -
            collection.reload +
            collection.reload

            Returns a Relation of all of the associated objects, forcing a database read. An empty Relation is returned if none are found.

            @@ -1418,21 +1418,21 @@

            Extensions

          Options

          -
          :class_name +
          :class_name

          Specify the class name of the association. Use it only if that name can’t be inferred from the association name. So has_many :products will by default be linked to the Product class, but if the real class name is SpecialProduct, you’ll have to specify it with this option.

          -
          :foreign_key +
          :foreign_key

          Specify the foreign key used for the association. By default this is guessed to be the name of this class in lower-case and “_id” suffixed. So a Person class that makes a has_many association will use “person_id” as the default :foreign_key.

          Setting the :foreign_key option prevents automatic detection of the association’s inverse, so it is generally a good idea to set the :inverse_of option as well.

          -
          :foreign_type +
          :foreign_type

          Specify the column used to store the associated object’s type, if this is a polymorphic association. By default this is guessed to be the name of the polymorphic association specified on “as” option with a “_type” suffix. So a class that defines a has_many :tags, as: :taggable association will use “taggable_type” as the default :foreign_type.

          -
          :primary_key +
          :primary_key

          Specify the name of the column to use as the primary key for the association. By default this is id.

          -
          :dependent +
          :dependent

          Controls what happens to the associated objects when their owner is destroyed. Note that these are implemented as callbacks, and Rails executes callbacks in order. Therefore, other similar callbacks may affect the :dependent behavior, and the :dependent behavior may affect other callbacks.

          • @@ -1454,52 +1454,52 @@

            Options

            If using with the :through option, the association on the join model must be a belongs_to, and the records which get deleted are the join records, rather than the associated records.

            If using dependent: :destroy on a scoped association, only the scoped objects are destroyed. For example, if a Post model defines has_many :comments, -> { where published: true }, dependent: :destroy and destroy is called on a post, only published comments are destroyed. This means that any unpublished comments in the database would still contain a foreign key pointing to the now deleted post.

            -
          :counter_cache +
          :counter_cache

          This option can be used to configure a custom named :counter_cache. You only need this option, when you customized the name of your :counter_cache on the belongs_to association.

          -
          :as +
          :as

          Specifies a polymorphic interface (See belongs_to).

          -
          :through +
          :through

          Specifies an association through which to perform the query. This can be any other type of association, including other :through associations. Options for :class_name, :primary_key and :foreign_key are ignored, as the association uses the source reflection.

          If the association on the join model is a belongs_to, the collection can be modified and the records on the :through model will be automatically created and removed as appropriate. Otherwise, the collection is read-only, so you should manipulate the :through association directly.

          If you are going to modify the association (rather than just read from it), then it is a good idea to set the :inverse_of option on the source association on the join model. This allows associated records to be built which will automatically create the appropriate join model records when they are saved. See Association Join Models and Setting Inverses for more detail.

          -
          :disable_joins +
          :disable_joins
          -

          Specifies whether joins should be skipped for an association. If set to true, two or more queries will be generated. Note that in some cases, if order or limit is applied, it will be done in-memory due to database limitations. This option is only applicable on has_many :through associations as has_many alone do not perform a join.

          -
          :source +

          Specifies whether joins should be skipped for an association. If set to true, two or more queries will be generated. Note that in some cases, if order or limit is applied, it will be done in-memory due to database limitations. This option is only applicable on has_many :through associations as has_many alone do not perform a join.

          +
          :source

          Specifies the source association name used by has_many :through queries. Only use it if the name cannot be inferred from the association. has_many :subscribers, through: :subscriptions will look for either :subscribers or :subscriber on Subscription, unless a :source is given.

          -
          :source_type +
          :source_type

          Specifies type of the source association used by has_many :through queries where the source association is a polymorphic belongs_to.

          -
          :validate +
          :validate

          When set to true, validates new objects added to association when saving the parent object. true by default. If you want to ensure associated objects are revalidated on every update, use validates_associated.

          -
          :autosave +
          :autosave

          If true, always save the associated objects or destroy them if marked for destruction, when saving the parent object. If false, never save or destroy the associated objects. By default, only save associated objects that are new records. This option is implemented as a before_save callback. Because callbacks are run in the order they are defined, associated objects may need to be explicitly saved in any user-defined before_save callbacks.

          Note that NestedAttributes::ClassMethods#accepts_nested_attributes_for sets :autosave to true.

          -
          :inverse_of +
          :inverse_of

          Specifies the name of the belongs_to association on the associated object that is the inverse of this has_many association. See Bi-directional associations for more detail.

          -
          :extend +
          :extend

          Specifies a module or array of modules that will be extended into the association object returned. Useful for defining methods on associations, especially when they should be shared between multiple association objects.

          -
          :strict_loading +
          :strict_loading

          When set to true, enforces strict loading every time the associated record is loaded through this association.

          -
          :ensuring_owner_was +
          :ensuring_owner_was

          Specifies an instance method to be called on the owner. The method must return true in order for the associated records to be deleted in a background job.

          -
          :query_constraints +
          :query_constraints

          Serves as a composite foreign key. Defines the list of columns to be used to query the associated object. This is an optional option. By default Rails will attempt to derive the value automatically. When the value is set the Array size must match associated model’s primary key or query_constraints size.

          -
          :index_errors +
          :index_errors

          Allows differentiation of multiple validation errors from the association records, by including an index in the error attribute name, e.g. roles[2].level. When set to true, the index is based on association order, i.e. database order, with yet to be persisted new records placed at the end. When set to :nested_attributes_order, the index is based on the record order received by nested attributes setter, when accepts_nested_attributes_for is used.

          @@ -1559,25 +1559,25 @@

          The following methods for retrieval and query of a single associated object will be added:

          association is a placeholder for the symbol passed as the name argument, so has_one :manager would add among others manager.nil?.

          -
          association +
          association

          Returns the associated object. nil is returned if none is found.

          -
          association=(associate) +
          association=(associate)

          Assigns the associate object, extracts the primary key, sets it as the foreign key, and saves the associate object. To avoid database inconsistencies, permanently deletes an existing associated object when assigning a new one, even if the new one isn’t saved to database.

          -
          build_association(attributes = {}) +
          build_association(attributes = {})

          Returns a new object of the associated type that has been instantiated with attributes and linked to this object through a foreign key, but has not yet been saved.

          -
          create_association(attributes = {}) +
          create_association(attributes = {})

          Returns a new object of the associated type that has been instantiated with attributes, linked to this object through a foreign key, and that has already been saved (if it passed the validation).

          -
          create_association!(attributes = {}) +
          create_association!(attributes = {})

          Does the same as create_association, but raises ActiveRecord::RecordInvalid if the record is invalid.

          -
          reload_association +
          reload_association

          Returns the associated object, forcing a database read.

          -
          reset_association +
          reset_association

          Unloads the associated object. The next access will query it from the database.

          @@ -1619,10 +1619,10 @@

          Options

          The declaration can also include an options hash to specialize the behavior of the association.

          Options are:

          -
          :class_name +
          :class_name

          Specify the class name of the association. Use it only if that name can’t be inferred from the association name. So has_one :manager will by default be linked to the Manager class, but if the real class name is Person, you’ll have to specify it with this option.

          -
          :dependent +
          :dependent

          Controls what happens to the associated object when its owner is destroyed:

          • @@ -1642,62 +1642,62 @@

            Options

          Note that :dependent option is ignored when using :through option.

          -
          :foreign_key +
          :foreign_key

          Specify the foreign key used for the association. By default this is guessed to be the name of this class in lower-case and “_id” suffixed. So a Person class that makes a has_one association will use “person_id” as the default :foreign_key.

          Setting the :foreign_key option prevents automatic detection of the association’s inverse, so it is generally a good idea to set the :inverse_of option as well.

          -
          :foreign_type +
          :foreign_type

          Specify the column used to store the associated object’s type, if this is a polymorphic association. By default this is guessed to be the name of the polymorphic association specified on “as” option with a “_type” suffix. So a class that defines a has_one :tag, as: :taggable association will use “taggable_type” as the default :foreign_type.

          -
          :primary_key +
          :primary_key

          Specify the method that returns the primary key used for the association. By default this is id.

          -
          :as +
          :as

          Specifies a polymorphic interface (See belongs_to).

          -
          :through +
          :through

          Specifies a Join Model through which to perform the query. Options for :class_name, :primary_key, and :foreign_key are ignored, as the association uses the source reflection. You can only use a :through query through a has_one or belongs_to association on the join model.

          If the association on the join model is a belongs_to, the collection can be modified and the records on the :through model will be automatically created and removed as appropriate. Otherwise, the collection is read-only, so you should manipulate the :through association directly.

          If you are going to modify the association (rather than just read from it), then it is a good idea to set the :inverse_of option on the source association on the join model. This allows associated records to be built which will automatically create the appropriate join model records when they are saved. See Association Join Models and Setting Inverses for more detail.

          -
          :disable_joins +
          :disable_joins
          -

          Specifies whether joins should be skipped for an association. If set to true, two or more queries will be generated. Note that in some cases, if order or limit is applied, it will be done in-memory due to database limitations. This option is only applicable on has_one :through associations as has_one alone does not perform a join.

          -
          :source +

          Specifies whether joins should be skipped for an association. If set to true, two or more queries will be generated. Note that in some cases, if order or limit is applied, it will be done in-memory due to database limitations. This option is only applicable on has_one :through associations as has_one alone does not perform a join.

          +
          :source

          Specifies the source association name used by has_one :through queries. Only use it if the name cannot be inferred from the association. has_one :favorite, through: :favorites will look for a :favorite on Favorite, unless a :source is given.

          -
          :source_type +
          :source_type

          Specifies type of the source association used by has_one :through queries where the source association is a polymorphic belongs_to.

          -
          :validate +
          :validate

          When set to true, validates new objects added to association when saving the parent object. false by default. If you want to ensure associated objects are revalidated on every update, use validates_associated.

          -
          :autosave +
          :autosave

          If true, always saves the associated object or destroys it if marked for destruction, when saving the parent object. If false, never save or destroy the associated object.

          By default, only saves the associated object if it’s a new record. Setting this option to true also enables validations on the associated object unless explicitly disabled with validate: false. This is because saving an object with invalid associated objects would fail, so any associated objects will go through validation checks.

          Note that NestedAttributes::ClassMethods#accepts_nested_attributes_for sets :autosave to true.

          -
          :touch +
          :touch

          If true, the associated object will be touched (the updated_at / updated_on attributes set to current time) when this record is either saved or destroyed. If you specify a symbol, that attribute will be updated with the current time in addition to the updated_at / updated_on attribute. Please note that no validation will be performed when touching, and only the after_touch, after_commit, and after_rollback callbacks will be executed.

          -
          :inverse_of +
          :inverse_of

          Specifies the name of the belongs_to association on the associated object that is the inverse of this has_one association. See Bi-directional associations for more detail.

          -
          :required +
          :required

          When set to true, the association will also have its presence validated. This will validate the association itself, not the id. You can use :inverse_of to avoid an extra query during validation.

          -
          :strict_loading +
          :strict_loading

          Enforces strict loading every time the associated record is loaded through this association.

          -
          :ensuring_owner_was +
          :ensuring_owner_was

          Specifies an instance method to be called on the owner. The method must return true in order for the associated records to be deleted in a background job.

          -
          :query_constraints +
          :query_constraints

          Serves as a composite foreign key. Defines the list of columns to be used to query the associated object. This is an optional option. By default Rails will attempt to derive the value automatically. When the value is set the Array size must match associated model’s primary key or query_constraints size.

          diff --git a/src/7.2/classes/ActiveRecord/Associations/CollectionProxy.html b/src/7.2/classes/ActiveRecord/Associations/CollectionProxy.html index c1782017ce..cf190bed3c 100644 --- a/src/7.2/classes/ActiveRecord/Associations/CollectionProxy.html +++ b/src/7.2/classes/ActiveRecord/Associations/CollectionProxy.html @@ -566,7 +566,7 @@

          -

          Equivalent to delete_all. The difference is that returns self, instead of an array with the deleted objects, so methods can be chained. See delete_all for more information. Note that because delete_all removes records by directly running an SQL query into the database, the updated_at column of the object is not changed.

          +

          Equivalent to delete_all. The difference is that returns self, instead of an array with the deleted objects, so methods can be chained. See delete_all for more information. Note that because delete_all removes records by directly running an SQL query into the database, the updated_at column of the object is not changed.

          @@ -864,7 +864,7 @@

          # => ActiveRecord::RecordNotFound: Couldn't find Pet with 'id'=1

        -

        You can pass Integer or String values, it finds the records responding to the id and executes delete on them.

        +

        You can pass Integer or String values, it finds the records responding to the id and executes delete on them.

        class Person < ActiveRecord::Base
           has_many :pets
        @@ -1066,7 +1066,7 @@ 

        Pet.find(1, 2, 3) # => ActiveRecord::RecordNotFound: Couldn't find all Pets with 'id': (1, 2, 3)

        -

        You can pass Integer or String values, it finds the records responding to the id and then deletes them from the database.

        +

        You can pass Integer or String values, it finds the records responding to the id and then deletes them from the database.

        person.pets.size # => 3
         person.pets
        diff --git a/src/7.2/classes/ActiveRecord/AttributeMethods.html b/src/7.2/classes/ActiveRecord/AttributeMethods.html
        index 13431cfcb3..6586c2991e 100644
        --- a/src/7.2/classes/ActiveRecord/AttributeMethods.html
        +++ b/src/7.2/classes/ActiveRecord/AttributeMethods.html
        @@ -401,7 +401,7 @@ 

        -

        Returns an #inspect-like string for the value of the attribute attr_name. String attributes are truncated up to 50 characters. Other attributes return the value of #inspect without modification.

        +

        Returns an inspect-like string for the value of the attribute attr_name. String attributes are truncated up to 50 characters. Other attributes return the value of inspect without modification.

        person = Person.create!(name: 'David Heinemeier Hansson ' * 3)
         
        diff --git a/src/7.2/classes/ActiveRecord/AttributeMethods/Dirty.html b/src/7.2/classes/ActiveRecord/AttributeMethods/Dirty.html
        index 7ac02845de..2403ed9aa5 100644
        --- a/src/7.2/classes/ActiveRecord/AttributeMethods/Dirty.html
        +++ b/src/7.2/classes/ActiveRecord/AttributeMethods/Dirty.html
        @@ -500,10 +500,10 @@ 

        This method is useful in after callbacks to determine if an attribute was changed during the save that triggered the callbacks to run. It can be invoked as saved_change_to_name? instead of saved_change_to_attribute?("name").

        Options

        -
        from +
        from

        When specified, this method will return false unless the original value is equal to the given value.

        -
        to +
        to

        When specified, this method will return false unless the value will be changed to the given value.

        @@ -616,10 +616,10 @@

        This method is useful in validations and before callbacks to determine if the next call to save will change a particular attribute. It can be invoked as will_save_change_to_name? instead of will_save_change_to_attribute?("name").

        Options

        -
        from +
        from

        When specified, this method will return false unless the original value is equal to the given value.

        -
        to +
        to

        When specified, this method will return false unless the value will be changed to the given value.

        diff --git a/src/7.2/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html b/src/7.2/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html index 8120f5a626..2bdade422d 100644 --- a/src/7.2/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html +++ b/src/7.2/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html @@ -70,7 +70,7 @@

        The serialization format may be YAML, JSON, or any custom format using a custom coder class.

        -

        Keep in mind that database adapters handle certain serialization tasks for you. For instance: json and jsonb types in PostgreSQL will be converted between JSON object/array syntax and Ruby Hash or Array objects transparently. There is no need to use serialize in this case.

        +

        Keep in mind that database adapters handle certain serialization tasks for you. For instance: json and jsonb types in PostgreSQL will be converted between JSON object/array syntax and Ruby Hash or Array objects transparently. There is no need to use serialize in this case.

        For more complex cases, such as conversion to or from your application domain objects, consider using the ActiveRecord::Attributes API.

        @@ -92,7 +92,7 @@

        Parameters

      • yaml - Optional. Yaml specific options. The allowed config is:

        • -

          :permitted_classes - Array with the permitted classes.

          +

          :permitted_classes - Array with the permitted classes.

        • :unsafe_load - Unsafely load YAML blobs, allow YAML to load any class.

        @@ -156,7 +156,7 @@
        Ensure serializ

        Some serialization methods may accept some types they don’t support by silently casting them to other types. This can cause bugs when the data is deserialized.

        -

        For instance the JSON serializer provided in the standard library will silently cast unsupported types to String:

        +

        For instance the JSON serializer provided in the standard library will silently cast unsupported types to String:

        >> JSON.parse(JSON.dump(Struct.new(:foo)))
         => "#<Class:0x000000013090b4c0>"
        @@ -178,7 +178,7 @@ 
        -
        Serialize the preferences Hash using YAML
        +
        Serialize the preferences Hash using YAML
        class User < ActiveRecord::Base
           serialize :preferences, type: Hash, coder: YAML
        diff --git a/src/7.2/classes/ActiveRecord/Attributes/ClassMethods.html b/src/7.2/classes/ActiveRecord/Attributes/ClassMethods.html
        index 4644f08965..d9e2ce4a5d 100644
        --- a/src/7.2/classes/ActiveRecord/Attributes/ClassMethods.html
        +++ b/src/7.2/classes/ActiveRecord/Attributes/ClassMethods.html
        @@ -281,7 +281,7 @@ 

        This API only accepts type objects, and will do its work immediately instead of waiting for the schema to load. While this method is provided so it can be used by plugin authors, application code should probably use ClassMethods#attribute.

        -

        name The name of the attribute being defined. Expected to be a String.

        +

        name The name of the attribute being defined. Expected to be a String.

        cast_type The type object to use for this attribute.

        diff --git a/src/7.2/classes/ActiveRecord/ConnectionAdapters/AbstractAdapter.html b/src/7.2/classes/ActiveRecord/ConnectionAdapters/AbstractAdapter.html index 3dc5a67721..3409422aa1 100644 --- a/src/7.2/classes/ActiveRecord/ConnectionAdapters/AbstractAdapter.html +++ b/src/7.2/classes/ActiveRecord/ConnectionAdapters/AbstractAdapter.html @@ -876,7 +876,7 @@

        -

        Override to check all foreign key constraints in a database. The adapter should raise a ActiveRecord::StatementInvalid if foreign key constraints are not met.

        +

        Override to check all foreign key constraints in a database. The adapter should raise a ActiveRecord::StatementInvalid if foreign key constraints are not met.

        diff --git a/src/7.2/classes/ActiveRecord/ConnectionAdapters/AbstractMysqlAdapter.html b/src/7.2/classes/ActiveRecord/ConnectionAdapters/AbstractMysqlAdapter.html index 9d1a5a17a7..10ee63e0e3 100644 --- a/src/7.2/classes/ActiveRecord/ConnectionAdapters/AbstractMysqlAdapter.html +++ b/src/7.2/classes/ActiveRecord/ConnectionAdapters/AbstractMysqlAdapter.html @@ -756,13 +756,13 @@

        Drops a table from the database.

        -
        :force +
        :force

        Set to :cascade to drop dependent objects as well. Defaults to false.

        -
        :if_exists +
        :if_exists

        Set to true to only drop the table if it exists. Defaults to false.

        -
        :temporary +
        :temporary

        Set to true to drop temporary table. Defaults to false.

        diff --git a/src/7.2/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html b/src/7.2/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html index 9b31f083aa..add93faa27 100644 --- a/src/7.2/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html +++ b/src/7.2/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html @@ -41,7 +41,7 @@

        Introduction

        -

        A connection pool synchronizes thread access to a limited number of database connections. The basic idea is that each thread checks out a database connection from the pool, uses that connection, and checks the connection back in. ConnectionPool is completely thread-safe, and will ensure that a connection cannot be used by two threads at the same time, as long as ConnectionPool’s contract is correctly followed. It will also handle cases in which there are more threads than connections: if all connections have been checked out, and a thread tries to checkout a connection anyway, then ConnectionPool will wait until some other thread has checked in a connection, or the checkout_timeout has expired.

        +

        A connection pool synchronizes thread access to a limited number of database connections. The basic idea is that each thread checks out a database connection from the pool, uses that connection, and checks the connection back in. ConnectionPool is completely thread-safe, and will ensure that a connection cannot be used by two threads at the same time, as long as ConnectionPool’s contract is correctly followed. It will also handle cases in which there are more threads than connections: if all connections have been checked out, and a thread tries to checkout a connection anyway, then ConnectionPool will wait until some other thread has checked in a connection, or the checkout_timeout has expired.

        Obtaining (checking out) a connection

        @@ -66,7 +66,7 @@

        Op

      • idle_timeout: number of seconds that a connection will be kept unused in the pool before it is automatically disconnected (default 300 seconds). Set this to zero to keep connections forever.

      • -

        checkout_timeout: number of seconds to wait for a connection to become available before giving up and raising a timeout error (default 5 seconds).

        +

        checkout_timeout: number of seconds to wait for a connection to become available before giving up and raising a timeout error (default 5 seconds).

      @@ -339,7 +339,7 @@

      -

      Creates a new ConnectionPool object. pool_config is a PoolConfig object which describes database connection information (e.g. adapter, host name, username, password, etc), as well as the maximum size for this ConnectionPool.

      +

      Creates a new ConnectionPool object. pool_config is a PoolConfig object which describes database connection information (e.g. adapter, host name, username, password, etc), as well as the maximum size for this ConnectionPool.

      The default ConnectionPool maximum size is 5.

      diff --git a/src/7.2/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html b/src/7.2/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html index 3dac9d4d75..24f3810684 100644 --- a/src/7.2/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html +++ b/src/7.2/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html @@ -777,7 +777,7 @@

      -

      Inserts the given fixture into the table. Overridden in adapters that require something beyond a simple insert (e.g. Oracle). Most of adapters should implement insert_fixtures_set that leverages bulk SQL insert. We keep this method to provide fallback for databases like SQLite that do not support bulk inserts.

      +

      Inserts the given fixture into the table. Overridden in adapters that require something beyond a simple insert (e.g. Oracle). Most of adapters should implement insert_fixtures_set that leverages bulk SQL insert. We keep this method to provide fallback for databases like SQLite that do not support bulk inserts.

      diff --git a/src/7.2/classes/ActiveRecord/ConnectionAdapters/PostgreSQL/DatabaseStatements.html b/src/7.2/classes/ActiveRecord/ConnectionAdapters/PostgreSQL/DatabaseStatements.html index 70d3ba7065..69cb2edeaf 100644 --- a/src/7.2/classes/ActiveRecord/ConnectionAdapters/PostgreSQL/DatabaseStatements.html +++ b/src/7.2/classes/ActiveRecord/ConnectionAdapters/PostgreSQL/DatabaseStatements.html @@ -237,7 +237,7 @@

      Set when constraints will be checked for the current transaction.

      Not passing any specific constraint names will set the value for all deferrable constraints.

      -
      deferred +
      deferred

      Valid values are :deferred or :immediate.

      diff --git a/src/7.2/classes/ActiveRecord/ConnectionAdapters/PostgreSQL/SchemaStatements.html b/src/7.2/classes/ActiveRecord/ConnectionAdapters/PostgreSQL/SchemaStatements.html index c98887f721..c2c11ec656 100644 --- a/src/7.2/classes/ActiveRecord/ConnectionAdapters/PostgreSQL/SchemaStatements.html +++ b/src/7.2/classes/ActiveRecord/ConnectionAdapters/PostgreSQL/SchemaStatements.html @@ -197,16 +197,16 @@

    The options hash can include the following keys:

    -
    :name +
    :name

    The constraint name. Defaults to excl_rails_<identifier>.

    -
    :deferrable +
    :deferrable

    Specify whether or not the exclusion constraint should be deferrable. Valid values are false or :immediate or :deferred to specify the default behavior. Defaults to false.

    -
    :using +
    :using

    Specify which index method to use when creating this exclusion constraint (e.g. :btree, :gist etc).

    -
    :where +
    :where

    Specify an exclusion constraint on a subset of the table (internally PostgreSQL creates a partial index for this).

    @@ -301,13 +301,13 @@

    The options hash can include the following keys:

    -
    :name +
    :name

    The constraint name. Defaults to uniq_rails_<identifier>.

    -
    :deferrable +
    :deferrable

    Specify whether or not the unique constraint should be deferrable. Valid values are false or :immediate or :deferred to specify the default behavior. Defaults to false.

    -
    :using_index +
    :using_index

    To specify an existing unique index name. Defaults to nil.

    diff --git a/src/7.2/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html b/src/7.2/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html index d91e95f681..23b2050667 100644 --- a/src/7.2/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html +++ b/src/7.2/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html @@ -973,7 +973,7 @@

    Removes an extension from the database.

    -
    :force +
    :force

    Set to :cascade to drop dependent objects as well. Defaults to false.

    diff --git a/src/7.2/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html b/src/7.2/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html index 8f5b5dbf57..a6432a1eee 100644 --- a/src/7.2/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html +++ b/src/7.2/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html @@ -310,13 +310,13 @@

    The options hash can include the following keys:

    -
    :name +
    :name

    The constraint name. Defaults to chk_rails_<identifier>.

    -
    :if_not_exists +
    :if_not_exists

    Silently ignore if the constraint already exists, rather than raise an error.

    -
    :validate +
    :validate

    (PostgreSQL only) Specify whether or not the constraint should be validated. Defaults to true.

    @@ -525,28 +525,28 @@
    Creatin

    The options hash can include the following keys:

    -
    :column +
    :column

    The foreign key column name on from_table. Defaults to to_table.singularize + "_id". Pass an array to create a composite foreign key.

    -
    :primary_key +
    :primary_key

    The primary key column name on to_table. Defaults to id. Pass an array to create a composite foreign key.

    -
    :name +
    :name

    The constraint name. Defaults to fk_rails_<identifier>.

    -
    :on_delete +
    :on_delete

    Action that happens ON DELETE. Valid values are :nullify, :cascade, and :restrict

    -
    :on_update +
    :on_update

    Action that happens ON UPDATE. Valid values are :nullify, :cascade, and :restrict

    -
    :if_not_exists +
    :if_not_exists

    Specifies if the foreign key already exists to not try to re-add it. This will avoid duplicate column errors.

    -
    :validate +
    :validate

    (PostgreSQL only) Specify whether or not the constraint should be validated. Defaults to true.

    -
    :deferrable +
    :deferrable

    (PostgreSQL only) Specify whether or not the foreign key should be deferrable. Valid values are booleans or :deferred or :immediate to specify the default behavior. Defaults to false.

    @@ -786,19 +786,19 @@

    Adds a reference. The reference column is a bigint by default, the :type option can be used to specify a different type. Optionally adds a _type column, if :polymorphic option is provided.

    The options hash can include the following keys:

    -
    :type +
    :type

    The reference column type. Defaults to :bigint.

    -
    :index +
    :index

    Add an appropriate index. Defaults to true. See add_index for usage of this option.

    -
    :foreign_key +
    :foreign_key

    Add an appropriate foreign key constraint. Defaults to false, pass true to add. In case the join table can’t be inferred from the association pass :to_table with the appropriate table name.

    -
    :polymorphic +
    :polymorphic

    Whether an additional _type column should be added. Defaults to false.

    -
    :null +
    :null

    Whether the column allows nulls. Defaults to true.

    @@ -1193,7 +1193,7 @@

    The options hash can include the following keys:

    -
    :bulk +
    :bulk

    Set this to true to make this a bulk alter query, such as

    @@ -1535,19 +1535,19 @@

    You can pass an options hash which can include the following keys:

    -
    :table_name +
    :table_name

    Sets the table name, overriding the default.

    -
    :column_options +
    :column_options

    Any extra options you want appended to the columns definition.

    -
    :options +
    :options

    Any extra options you want appended to the table definition.

    -
    :temporary +
    :temporary

    Make a temporary table.

    -
    :force +
    :force

    Set to true to drop the table before creating it. Defaults to false.

    @@ -1650,31 +1650,31 @@

    Regular form

    The options hash can include the following keys:

    -
    :id +
    :id

    Whether to automatically add a primary key column. Defaults to true. Join tables for ActiveRecord::Base.has_and_belongs_to_many should set it to false.

    A Symbol can be used to specify the type of the generated primary key column.

    -
    :primary_key +
    :primary_key

    The name of the primary key, if one is to be added automatically. Defaults to id. If :id is false, then this option is ignored.

    If an array is passed, a composite primary key will be created.

    Note that Active Record models will automatically detect their primary key. This can be avoided by using self.primary_key= on the model to define the key explicitly.

    -
    :options +
    :options

    Any extra options you want appended to the table definition.

    -
    :temporary +
    :temporary

    Make a temporary table.

    -
    :force +
    :force

    Set to true to drop the table before creating it. Set to :cascade to drop dependent objects as well. Defaults to false.

    -
    :if_not_exists +
    :if_not_exists

    Set to true to avoid raising an error when the table already exists. Defaults to false.

    -
    :as +
    :as

    SQL to use to generate the table. When this option is used, the block is ignored, as are the :id and :primary_key options.

    @@ -1952,10 +1952,10 @@

    Drops a table from the database.

    -
    :force +
    :force

    Set to :cascade to drop dependent objects as well. Defaults to false.

    -
    :if_exists +
    :if_exists

    Set to true to only drop the table if it exists. Defaults to false.

    @@ -2542,7 +2542,7 @@

    The options hash accepts the same keys as SchemaStatements#add_foreign_key with an addition of

    -
    :to_table +
    :to_table

    The name of the table that contains the referenced primary key.

    diff --git a/src/7.2/classes/ActiveRecord/ConnectionHandling.html b/src/7.2/classes/ActiveRecord/ConnectionHandling.html index 5eed456be0..98b4e6118a 100644 --- a/src/7.2/classes/ActiveRecord/ConnectionHandling.html +++ b/src/7.2/classes/ActiveRecord/ConnectionHandling.html @@ -264,7 +264,7 @@

    Connects to a role (e.g. writing, reading, or a custom role) and/or shard for the duration of the block. At the end of the block the connection will be returned to the original role / shard.

    -

    If only a role is passed, Active Record will look up the connection based on the requested role. If a non-established role is requested an ActiveRecord::ConnectionNotEstablished error will be raised:

    +

    If only a role is passed, Active Record will look up the connection based on the requested role. If a non-established role is requested an ActiveRecord::ConnectionNotEstablished error will be raised:

    ActiveRecord::Base.connected_to(role: :writing) do
       Dog.create! # creates dog using dog writing connection
    @@ -275,7 +275,7 @@ 

    end

    -

    When swapping to a shard, the role must be passed as well. If a non-existent shard is passed, an ActiveRecord::ConnectionNotEstablished error will be raised.

    +

    When swapping to a shard, the role must be passed as well. If a non-existent shard is passed, an ActiveRecord::ConnectionNotEstablished error will be raised.

    When a shard and role is passed, Active Record will first lookup the role, and then look up the connection by shard key.

    @@ -378,7 +378,7 @@

    Connects a role and/or shard to the provided connection names. Optionally prevent_writes can be passed to block writes on a connection. reading will automatically set prevent_writes to true.

    -

    connected_to_many is an alternative to deeply nested connected_to blocks.

    +

    connected_to_many is an alternative to deeply nested connected_to blocks.

    Usage:

    @@ -437,7 +437,7 @@

    This method is useful for ensuring that a specific connection is being used. For example, when booting a console in readonly mode.

    -

    It is not recommended to use this method in a request since it does not yield to a block like connected_to.

    +

    It is not recommended to use this method in a request since it does not yield to a block like connected_to.

    @@ -474,7 +474,7 @@

    -

    Soft deprecated. Use #with_connection or #lease_connection instead.

    +

    Soft deprecated. Use with_connection or lease_connection instead.

    @@ -654,7 +654,7 @@

    end

    -

    connects_to also supports horizontal sharding. The horizontal sharding API supports read replicas as well. You can connect a model to a list of shards like this:

    +

    connects_to also supports horizontal sharding. The horizontal sharding API supports read replicas as well. You can connect a model to a list of shards like this:

    class AnimalsModel < ApplicationRecord
       self.abstract_class = true
    @@ -800,7 +800,7 @@ 

    -

    Returns the connection currently associated with the class. This can also be used to “borrow” the connection to do database work unrelated to any of the specific Active Records. The connection will remain leased for the entire duration of the request or job, or until #release_connection is called.

    +

    Returns the connection currently associated with the class. This can also be used to “borrow” the connection to do database work unrelated to any of the specific Active Records. The connection will remain leased for the entire duration of the request or job, or until release_connection is called.

    @@ -1027,7 +1027,7 @@

    Prevent writing to the database regardless of role.

    -

    In some cases you may want to prevent writes to the database even if you are on a database that can write. while_preventing_writes will prevent writes to the database for the duration of the block.

    +

    In some cases you may want to prevent writes to the database even if you are on a database that can write. while_preventing_writes will prevent writes to the database for the duration of the block.

    This method does not provide the same protection as a readonly user and is meant to be a safeguard against accidental writes.

    diff --git a/src/7.2/classes/ActiveRecord/Core.html b/src/7.2/classes/ActiveRecord/Core.html index 1c001e0fd9..24219c3c8d 100644 --- a/src/7.2/classes/ActiveRecord/Core.html +++ b/src/7.2/classes/ActiveRecord/Core.html @@ -667,7 +667,7 @@

    -

    Force enumeration of all columns in SELECT statements. e.g. SELECT first_name, last_name FROM ... instead of SELECT * FROM ... This avoids PreparedStatementCacheExpired errors when a column is added to the database while the app is running.

    +

    Force enumeration of all columns in SELECT statements. e.g. SELECT first_name, last_name FROM ... instead of SELECT * FROM ... This avoids PreparedStatementCacheExpired errors when a column is added to the database while the app is running.

    diff --git a/src/7.2/classes/ActiveRecord/Core/ClassMethods.html b/src/7.2/classes/ActiveRecord/Core/ClassMethods.html index 0f5e884dee..bf71827953 100644 --- a/src/7.2/classes/ActiveRecord/Core/ClassMethods.html +++ b/src/7.2/classes/ActiveRecord/Core/ClassMethods.html @@ -70,7 +70,7 @@

    -

    Returns columns which shouldn’t be exposed while calling #inspect.

    +

    Returns columns which shouldn’t be exposed while calling inspect.

    @@ -109,7 +109,7 @@

    -

    Specifies columns which shouldn’t be exposed while calling #inspect.

    +

    Specifies columns which shouldn’t be exposed while calling inspect.

    diff --git a/src/7.2/classes/ActiveRecord/DatabaseConfigurations.html b/src/7.2/classes/ActiveRecord/DatabaseConfigurations.html index 04247a56cd..5154bd1c11 100644 --- a/src/7.2/classes/ActiveRecord/DatabaseConfigurations.html +++ b/src/7.2/classes/ActiveRecord/DatabaseConfigurations.html @@ -41,7 +41,7 @@

    Active Record Database Configurations

    -

    ActiveRecord::DatabaseConfigurations returns an array of DatabaseConfig objects that are constructed from the application’s database configuration hash or URL string.

    +

    ActiveRecord::DatabaseConfigurations returns an array of DatabaseConfig objects that are constructed from the application’s database configuration hash or URL string.

    The array of DatabaseConfig objects in an application default to either a HashConfig or UrlConfig. You can retrieve your application’s config by using ActiveRecord::Base.configurations.

    @@ -198,7 +198,7 @@

    end

    -

    For configs that have a :vitess key, a VitessConfig object will be created instead of a UrlConfig.

    +

    For configs that have a :vitess key, a VitessConfig object will be created instead of a UrlConfig.

    @@ -372,7 +372,7 @@

    Returns a single DatabaseConfig object based on the requested environment.

    -

    If the application has multiple databases find_db_config will return the first DatabaseConfig for the environment.

    +

    If the application has multiple databases find_db_config will return the first DatabaseConfig for the environment.

    diff --git a/src/7.2/classes/ActiveRecord/DatabaseConfigurations/HashConfig.html b/src/7.2/classes/ActiveRecord/DatabaseConfigurations/HashConfig.html index c49534eef0..99b1cfed57 100644 --- a/src/7.2/classes/ActiveRecord/DatabaseConfigurations/HashConfig.html +++ b/src/7.2/classes/ActiveRecord/DatabaseConfigurations/HashConfig.html @@ -31,7 +31,7 @@

    Active Record Database Hash Config

    -

    A HashConfig object is created for each database configuration entry that is created from a hash.

    +

    A HashConfig object is created for each database configuration entry that is created from a hash.

    A hash config:

    @@ -174,7 +174,7 @@

    -

    Initialize a new HashConfig object

    +

    Initialize a new HashConfig object

    Parameters

    • @@ -182,7 +182,7 @@

      Parameters

    • name - The db config name. In a standard two-tier database configuration this will default to “primary”. In a multiple database three-tier database configuration this corresponds to the name used in the second tier, for example “primary_readonly”.

    • -

      configuration_hash - The config hash. This is the hash that contains the database adapter, name, and other important information for database connections.

      +

      configuration_hash - The config hash. This is the hash that contains the database adapter, name, and other important information for database connections.

    @@ -543,7 +543,7 @@

    -

    The migrations paths for a database configuration. If the migrations_paths key is present in the config, migrations_paths will return its value.

    +

    The migrations paths for a database configuration. If the migrations_paths key is present in the config, migrations_paths will return its value.

    @@ -683,7 +683,7 @@

    -

    reaping_frequency is configurable mostly for historical reasons, but it could also be useful if someone wants a very low idle_timeout.

    +

    reaping_frequency is configurable mostly for historical reasons, but it could also be useful if someone wants a very low idle_timeout.

    diff --git a/src/7.2/classes/ActiveRecord/DatabaseConfigurations/UrlConfig.html b/src/7.2/classes/ActiveRecord/DatabaseConfigurations/UrlConfig.html index 156d8a02ea..8a58fee8fa 100644 --- a/src/7.2/classes/ActiveRecord/DatabaseConfigurations/UrlConfig.html +++ b/src/7.2/classes/ActiveRecord/DatabaseConfigurations/UrlConfig.html @@ -31,7 +31,7 @@

    Active Record Database Url Config

    -

    A UrlConfig object is created for each database configuration entry that is created from a URL. This can either be a URL string or a hash with a URL in place of the config hash.

    +

    A UrlConfig object is created for each database configuration entry that is created from a URL. This can either be a URL string or a hash with a URL in place of the config hash.

    A URL config:

    @@ -108,7 +108,7 @@

    -

    Initialize a new UrlConfig object

    +

    Initialize a new UrlConfig object

    Options

    diff --git a/src/7.2/classes/ActiveRecord/Encryption/Contexts.html b/src/7.2/classes/ActiveRecord/Encryption/Contexts.html index acb010f0f9..3a01a8cdda 100644 --- a/src/7.2/classes/ActiveRecord/Encryption/Contexts.html +++ b/src/7.2/classes/ActiveRecord/Encryption/Contexts.html @@ -243,7 +243,7 @@

    Configures a custom encryption context to use when running the provided block of code.

    -

    It supports overriding all the properties defined in Context.

    +

    It supports overriding all the properties defined in Context.

    Example:

    diff --git a/src/7.2/classes/ActiveRecord/Encryption/EncryptableRecord.html b/src/7.2/classes/ActiveRecord/Encryption/EncryptableRecord.html index 1c8200d209..cc5e1cb70e 100644 --- a/src/7.2/classes/ActiveRecord/Encryption/EncryptableRecord.html +++ b/src/7.2/classes/ActiveRecord/Encryption/EncryptableRecord.html @@ -422,7 +422,7 @@

    Options

  • :ignore_case - When true, it behaves like :downcase but, it also preserves the original case in a specially designated column +original_<name>+. When reading the encrypted content, the version with the original case is served. But you can still execute queries that will ignore the case. This option can only be used when :deterministic is true.

  • -

    :context_properties - Additional properties that will override Context settings when this attribute is encrypted and decrypted. E.g: encryptor:, cipher:, message_serializer:, etc.

    +

    :context_properties - Additional properties that will override Context settings when this attribute is encrypted and decrypted. E.g: encryptor:, cipher:, message_serializer:, etc.

  • :previous - List of previous encryption schemes. When provided, they will be used in order when trying to read the attribute. Each entry of the list can contain the properties supported by encrypts. Also, when deterministic encryption is used, they will be used to generate additional ciphertexts to check in the queries.

  • diff --git a/src/7.2/classes/ActiveRecord/Encryption/EncryptedAttributeType.html b/src/7.2/classes/ActiveRecord/Encryption/EncryptedAttributeType.html index f1c732daa1..8caa828068 100644 --- a/src/7.2/classes/ActiveRecord/Encryption/EncryptedAttributeType.html +++ b/src/7.2/classes/ActiveRecord/Encryption/EncryptedAttributeType.html @@ -31,7 +31,7 @@

    An ActiveModel::Type::Value that encrypts/decrypts strings of text.

    -

    This is the central piece that connects the encryption system with encrypts declarations in the model classes. Whenever you declare an attribute as encrypted, it configures an EncryptedAttributeType for that attribute.

    +

    This is the central piece that connects the encryption system with encrypts declarations in the model classes. Whenever you declare an attribute as encrypted, it configures an EncryptedAttributeType for that attribute.

    @@ -141,7 +141,7 @@

    Options

    • -

      :scheme - A Scheme with the encryption properties for this attribute.

      +

      :scheme - A Scheme with the encryption properties for this attribute.

    • :cast_type - A type that will be used to serialize (before encrypting) and deserialize (after decrypting). ActiveModel::Type::String by default.

    diff --git a/src/7.2/classes/ActiveRecord/Encryption/Encryptor.html b/src/7.2/classes/ActiveRecord/Encryption/Encryptor.html index 2453f94c44..c58524d182 100644 --- a/src/7.2/classes/ActiveRecord/Encryption/Encryptor.html +++ b/src/7.2/classes/ActiveRecord/Encryption/Encryptor.html @@ -202,10 +202,10 @@

    Decrypts an encrypted_text and returns the result as clean text

    Options

    -
    :key_provider +
    :key_provider

    Key provider to use for the encryption operation. It will default to ActiveRecord::Encryption.key_provider when not provided

    -
    :cipher_options +
    :cipher_options

    Cipher-specific options that will be passed to the Cipher configured in ActiveRecord::Encryption.cipher

    @@ -262,10 +262,10 @@

    Options

    -
    :key_provider +
    :key_provider

    Key provider to use for the encryption operation. It will default to ActiveRecord::Encryption.key_provider when not provided.

    -
    :cipher_options +
    :cipher_options

    Cipher-specific options that will be passed to the Cipher configured in ActiveRecord::Encryption.cipher

    diff --git a/src/7.2/classes/ActiveRecord/Encryption/Key.html b/src/7.2/classes/ActiveRecord/Encryption/Key.html index 509d22df02..22f88080a0 100644 --- a/src/7.2/classes/ActiveRecord/Encryption/Key.html +++ b/src/7.2/classes/ActiveRecord/Encryption/Key.html @@ -31,7 +31,7 @@

    A key is a container for a given secret

    -

    Optionally, it can include public_tags. These tags are meant to be stored in clean (public) and can be used, for example, to include information that references the key for a future retrieval operation.

    +

    Optionally, it can include public_tags. These tags are meant to be stored in clean (public) and can be used, for example, to include information that references the key for a future retrieval operation.

    diff --git a/src/7.2/classes/ActiveRecord/Encryption/KeyGenerator.html b/src/7.2/classes/ActiveRecord/Encryption/KeyGenerator.html index 37d5826677..cbd47e1b81 100644 --- a/src/7.2/classes/ActiveRecord/Encryption/KeyGenerator.html +++ b/src/7.2/classes/ActiveRecord/Encryption/KeyGenerator.html @@ -142,7 +142,7 @@

    -

    Derives a key from the given password. The key will have a size in bytes of :length (configured Cipher‘s length by default)

    +

    Derives a key from the given password. The key will have a size in bytes of :length (configured Cipher‘s length by default)

    The generated key will be salted with the value of ActiveRecord::Encryption.key_derivation_salt

    @@ -180,7 +180,7 @@

    -

    Returns a random key in hexadecimal format. The key will have a size in bytes of :length (configured Cipher‘s length by default)

    +

    Returns a random key in hexadecimal format. The key will have a size in bytes of :length (configured Cipher‘s length by default)

    Hexadecimal format is handy for representing keys as printable text. To maximize the space of characters used, it is good practice including not printable characters. Hexadecimal format ensures that generated keys are representable with plain text

    @@ -222,7 +222,7 @@

    -

    Returns a random key. The key will have a size in bytes of :length (configured Cipher‘s length by default)

    +

    Returns a random key. The key will have a size in bytes of :length (configured Cipher‘s length by default)

    diff --git a/src/7.2/classes/ActiveRecord/Encryption/KeyProvider.html b/src/7.2/classes/ActiveRecord/Encryption/KeyProvider.html index 24007341e9..15bd4c9857 100644 --- a/src/7.2/classes/ActiveRecord/Encryption/KeyProvider.html +++ b/src/7.2/classes/ActiveRecord/Encryption/KeyProvider.html @@ -29,7 +29,7 @@

    -

    A KeyProvider serves keys:

    +

    A KeyProvider serves keys:

    • An encryption key

    • diff --git a/src/7.2/classes/ActiveRecord/Encryption/Properties.html b/src/7.2/classes/ActiveRecord/Encryption/Properties.html index ffe502d489..d7441d5d91 100644 --- a/src/7.2/classes/ActiveRecord/Encryption/Properties.html +++ b/src/7.2/classes/ActiveRecord/Encryption/Properties.html @@ -29,7 +29,7 @@

      -

      This is a wrapper for a hash of encryption properties. It is used by Key (public tags) and Message (headers).

      +

      This is a wrapper for a hash of encryption properties. It is used by Key (public tags) and Message (headers).

      Since properties are serialized in messages, it is important for storage efficiency to keep their keys as short as possible. It defines accessors for common properties that will keep these keys very short while exposing a readable name.

      diff --git a/src/7.2/classes/ActiveRecord/Encryption/ReadOnlyNullEncryptor.html b/src/7.2/classes/ActiveRecord/Encryption/ReadOnlyNullEncryptor.html index a291db3f56..6daeab5848 100644 --- a/src/7.2/classes/ActiveRecord/Encryption/ReadOnlyNullEncryptor.html +++ b/src/7.2/classes/ActiveRecord/Encryption/ReadOnlyNullEncryptor.html @@ -29,7 +29,7 @@

      -

      A NullEncryptor that will raise an error when trying to encrypt data

      +

      A NullEncryptor that will raise an error when trying to encrypt data

      This is useful when you want to reveal ciphertexts for debugging purposes and you want to make sure you won’t overwrite any encryptable attribute with the wrong content.

      diff --git a/src/7.2/classes/ActiveRecord/Inheritance.html b/src/7.2/classes/ActiveRecord/Inheritance.html index 6a9e93838c..0cdfd0075a 100644 --- a/src/7.2/classes/ActiveRecord/Inheritance.html +++ b/src/7.2/classes/ActiveRecord/Inheritance.html @@ -25,7 +25,7 @@

      Single table inheritance

      -

      Active Record allows inheritance by storing the name of the class in a column that by default is named “type” (can be changed by overwriting Base.inheritance_column). This means that an inheritance looking like this:

      +

      Active Record allows inheritance by storing the name of the class in a column that by default is named “type” (can be changed by overwriting Base.inheritance_column). This means that an inheritance looking like this:

      class Company < ActiveRecord::Base; end
       class Firm < Company; end
      diff --git a/src/7.2/classes/ActiveRecord/Inheritance/ClassMethods.html b/src/7.2/classes/ActiveRecord/Inheritance/ClassMethods.html
      index f6b3fca678..32ab50c9a4 100644
      --- a/src/7.2/classes/ActiveRecord/Inheritance/ClassMethods.html
      +++ b/src/7.2/classes/ActiveRecord/Inheritance/ClassMethods.html
      @@ -96,7 +96,7 @@ 

      Attributes

      [RW] abstract_class -

      Set this to true if this is an abstract class (see abstract_class?). If you are using inheritance with Active Record and don’t want a class to be considered as part of the STI hierarchy, you must set this to true. ApplicationRecord, for example, is generated as an abstract class.

      +

      Set this to true if this is an abstract class (see abstract_class?). If you are using inheritance with Active Record and don’t want a class to be considered as part of the STI hierarchy, you must set this to true. ApplicationRecord, for example, is generated as an abstract class.

      Consider the following default behavior:

      @@ -112,7 +112,7 @@

      Attributes

      Square.create! # => #<Square id: 3, type: "Square">
      -

      However, when using abstract_class, Shape is omitted from the hierarchy:

      +

      However, when using abstract_class, Shape is omitted from the hierarchy:

      class Shape < ActiveRecord::Base
         self.abstract_class = true
      @@ -136,7 +136,7 @@ 

      Attributes

      [R] base_class -

      Returns the first class in the inheritance hierarchy that descends from either an abstract class or from ActiveRecord::Base.

      +

      Returns the first class in the inheritance hierarchy that descends from either an abstract class or from ActiveRecord::Base.

      Consider the following behaviour:

      diff --git a/src/7.2/classes/ActiveRecord/Integration.html b/src/7.2/classes/ActiveRecord/Integration.html index 295d46c799..de237d29ce 100644 --- a/src/7.2/classes/ActiveRecord/Integration.html +++ b/src/7.2/classes/ActiveRecord/Integration.html @@ -362,7 +362,7 @@

      -

      Returns a String, which Action Pack uses for constructing a URL to this object. The default implementation returns this record’s id as a String, or nil if this record’s unsaved.

      +

      Returns a String, which Action Pack uses for constructing a URL to this object. The default implementation returns this record’s id as a String, or nil if this record’s unsaved.

      For example, suppose that you have a User model, and that you have a resources :users route. Normally, user_path will construct a path with the user object’s ‘id’ in it:

      @@ -370,7 +370,7 @@

      user_path(user) # => "/users/1"

      -

      You can override to_param in your model to make user_path construct a path using the user’s name instead of the user’s id:

      +

      You can override to_param in your model to make user_path construct a path using the user’s name instead of the user’s id:

      class User < ActiveRecord::Base
         def to_param  # overridden
      diff --git a/src/7.2/classes/ActiveRecord/Integration/ClassMethods.html b/src/7.2/classes/ActiveRecord/Integration/ClassMethods.html
      index 8b8ebd15cc..0a3faf508a 100644
      --- a/src/7.2/classes/ActiveRecord/Integration/ClassMethods.html
      +++ b/src/7.2/classes/ActiveRecord/Integration/ClassMethods.html
      @@ -66,7 +66,7 @@ 

      -

      Defines your model’s to_param method to generate “pretty” URLs using method_name, which can be any attribute or method that responds to to_s.

      +

      Defines your model’s to_param method to generate “pretty” URLs using method_name, which can be any attribute or method that responds to to_s.

      class User < ActiveRecord::Base
         to_param :name
      diff --git a/src/7.2/classes/ActiveRecord/IrreversibleMigration.html b/src/7.2/classes/ActiveRecord/IrreversibleMigration.html
      index 665102d8a7..c159f2a3a8 100644
      --- a/src/7.2/classes/ActiveRecord/IrreversibleMigration.html
      +++ b/src/7.2/classes/ActiveRecord/IrreversibleMigration.html
      @@ -48,7 +48,7 @@ 

      There are two ways to mitigate this problem.

      1. -

        Define #up and #down methods instead of #change:

        +

        Define up and down methods instead of change:

      class ReversibleMigrationExample < ActiveRecord::Migration[7.2]
      @@ -75,7 +75,7 @@ 

      end

      1. -

        Use the reversible method in #change method:

        +

        Use the reversible method in change method:

      class ReversibleMigrationExample < ActiveRecord::Migration[7.2]
      diff --git a/src/7.2/classes/ActiveRecord/Locking/Optimistic.html b/src/7.2/classes/ActiveRecord/Locking/Optimistic.html
      index 43eb8c5717..b91238f338 100644
      --- a/src/7.2/classes/ActiveRecord/Locking/Optimistic.html
      +++ b/src/7.2/classes/ActiveRecord/Locking/Optimistic.html
      @@ -27,11 +27,11 @@ 

      Optimistic locking allows multiple users to access the same record for edits, and assumes a minimum of conflicts with the data. It does this by checking whether another process has made changes to a record since it was opened, an ActiveRecord::StaleObjectError exception is thrown if that has occurred and the update is ignored.

      -

      Check out ActiveRecord::Locking::Pessimistic for an alternative.

      +

      Check out ActiveRecord::Locking::Pessimistic for an alternative.

      Usage

      -

      Active Record supports optimistic locking if the lock_version field is present. Each update to the record increments the integer column lock_version and the locking facilities ensure that records instantiated twice will let the last one saved raise a StaleObjectError if the first was also updated. Example:

      +

      Active Record supports optimistic locking if the lock_version field is present. Each update to the record increments the integer column lock_version and the locking facilities ensure that records instantiated twice will let the last one saved raise a StaleObjectError if the first was also updated. Example:

      p1 = Person.find(1)
       p2 = Person.find(1)
      diff --git a/src/7.2/classes/ActiveRecord/Locking/Optimistic/ClassMethods.html b/src/7.2/classes/ActiveRecord/Locking/Optimistic/ClassMethods.html
      index 296e866ff4..0e1eeb8c6a 100644
      --- a/src/7.2/classes/ActiveRecord/Locking/Optimistic/ClassMethods.html
      +++ b/src/7.2/classes/ActiveRecord/Locking/Optimistic/ClassMethods.html
      @@ -141,7 +141,7 @@ 

      -

      Returns true if the lock_optimistically flag is set to true (which it is, by default) and the table includes the locking_column column (defaults to lock_version).

      +

      Returns true if the lock_optimistically flag is set to true (which it is, by default) and the table includes the locking_column column (defaults to lock_version).

      diff --git a/src/7.2/classes/ActiveRecord/Locking/Pessimistic.html b/src/7.2/classes/ActiveRecord/Locking/Pessimistic.html index 82a80ef763..cb9ab0de2e 100644 --- a/src/7.2/classes/ActiveRecord/Locking/Pessimistic.html +++ b/src/7.2/classes/ActiveRecord/Locking/Pessimistic.html @@ -46,7 +46,7 @@

      Pes end

      -

      You can also use ActiveRecord::Base#lock! method to lock one record by id. This may be better if you don’t need to lock every row. Example:

      +

      You can also use ActiveRecord::Base#lock! method to lock one record by id. This may be better if you don’t need to lock every row. Example:

      Account.transaction do
         # select * from accounts where ...
      @@ -63,7 +63,7 @@ 

      Pes end

      -

      You can start a transaction and acquire the lock in one go by calling with_lock with a block. The block is called from within a transaction, the object is already locked. Example:

      +

      You can start a transaction and acquire the lock in one go by calling with_lock with a block. The block is called from within a transaction, the object is already locked. Example:

      account = Account.first
       account.with_lock do
      @@ -75,10 +75,10 @@ 

      Pes

      Database-specific information on row locking:

      -
      MySQL +
      MySQL

      dev.mysql.com/doc/refman/en/innodb-locking-reads.html

      -
      PostgreSQL +
      PostgreSQL

      www.postgresql.org/docs/current/interactive/sql-select.html#SQL-FOR-UPDATE-SHARE

      diff --git a/src/7.2/classes/ActiveRecord/Migration.html b/src/7.2/classes/ActiveRecord/Migration.html index 58f8253d6f..70663a21ff 100644 --- a/src/7.2/classes/ActiveRecord/Migration.html +++ b/src/7.2/classes/ActiveRecord/Migration.html @@ -242,9 +242,9 @@

      Controlling v

      By default, migrations will describe the actions they are taking, writing them to the console as they happen, along with benchmarks describing how long each step took.

      -

      You can quiet them down by setting ActiveRecord::Migration.verbose = false.

      +

      You can quiet them down by setting ActiveRecord::Migration.verbose = false.

      -

      You can also insert your own messages and benchmarks by using the say_with_time method:

      +

      You can also insert your own messages and benchmarks by using the say_with_time method:

      def up
         ...
      @@ -300,7 +300,7 @@ 

      Reversible Mi

      If a command cannot be reversed, an ActiveRecord::IrreversibleMigration exception will be raised when the migration is moving down.

      -

      For a list of commands that are reversible, please see ActiveRecord::Migration::CommandRecorder.

      +

      For a list of commands that are reversible, please see ActiveRecord::Migration::CommandRecorder.

      Transactional Migrations

      diff --git a/src/7.2/classes/ActiveRecord/Migration/CommandRecorder.html b/src/7.2/classes/ActiveRecord/Migration/CommandRecorder.html index e8fdf4abff..6a9e23e636 100644 --- a/src/7.2/classes/ActiveRecord/Migration/CommandRecorder.html +++ b/src/7.2/classes/ActiveRecord/Migration/CommandRecorder.html @@ -31,7 +31,7 @@

      Migration Command Recorder

      -

      ActiveRecord::Migration::CommandRecorder records commands done during a migration and knows how to reverse those commands. The CommandRecorder knows how to invert the following commands:

      +

      ActiveRecord::Migration::CommandRecorder records commands done during a migration and knows how to reverse those commands. The CommandRecorder knows how to invert the following commands:

      • add_column

      • @@ -272,7 +272,7 @@

        # => [[:add_column, :some_table, :foo, :string], [:add_column, :some_table, :bar, :string]]

      -

      This method will raise an IrreversibleMigration exception if it cannot invert the command.

      +

      This method will raise an IrreversibleMigration exception if it cannot invert the command.

      diff --git a/src/7.2/classes/ActiveRecord/MigrationContext.html b/src/7.2/classes/ActiveRecord/MigrationContext.html index 80e9250b90..348860a35a 100644 --- a/src/7.2/classes/ActiveRecord/MigrationContext.html +++ b/src/7.2/classes/ActiveRecord/MigrationContext.html @@ -33,7 +33,7 @@

      Migration

      MigrationContext sets the context in which a migration is run.

      -

      A migration context requires the path to the migrations is set in the migrations_paths parameter. Optionally a schema_migration class can be provided. Multiple database applications will instantiate a SchemaMigration object per database. From the Rake tasks, Rails will handle this for you.

      +

      A migration context requires the path to the migrations is set in the migrations_paths parameter. Optionally a schema_migration class can be provided. Multiple database applications will instantiate a SchemaMigration object per database. From the Rake tasks, Rails will handle this for you.

      diff --git a/src/7.2/classes/ActiveRecord/ModelSchema.html b/src/7.2/classes/ActiveRecord/ModelSchema.html index 2d07997f38..6da5a01c9d 100644 --- a/src/7.2/classes/ActiveRecord/ModelSchema.html +++ b/src/7.2/classes/ActiveRecord/ModelSchema.html @@ -221,12 +221,12 @@

      The name of the table column which stores the class name on single-table inheritance situations.

      -

      The default inheritance column name is type, which means it’s a reserved word inside Active Record. To be able to use single-table inheritance with another column name, or to use the column type in your own model for something else, you can set inheritance_column:

      +

      The default inheritance column name is type, which means it’s a reserved word inside Active Record. To be able to use single-table inheritance with another column name, or to use the column type in your own model for something else, you can set inheritance_column:

      self.inheritance_column = 'zoink'
       
      -

      If you wish to disable single-table inheritance altogether you can set inheritance_column to nil

      +

      If you wish to disable single-table inheritance altogether you can set inheritance_column to nil

      self.inheritance_column = nil
       
      @@ -577,7 +577,7 @@

      -

      Works like table_name_prefix=, but appends instead of prepends (set to “_basecamp” gives “projects_basecamp”, “people_basecamp”). By default, the suffix is the empty string.

      +

      Works like table_name_prefix=, but appends instead of prepends (set to “_basecamp” gives “projects_basecamp”, “people_basecamp”). By default, the suffix is the empty string.

      If you are organising your models within modules, you can add a suffix to the models within a namespace by defining a singleton method in the parent module called table_name_suffix which returns your chosen suffix.

      diff --git a/src/7.2/classes/ActiveRecord/NestedAttributes/ClassMethods.html b/src/7.2/classes/ActiveRecord/NestedAttributes/ClassMethods.html index 94801f83d6..b7adb06697 100644 --- a/src/7.2/classes/ActiveRecord/NestedAttributes/ClassMethods.html +++ b/src/7.2/classes/ActiveRecord/NestedAttributes/ClassMethods.html @@ -342,16 +342,16 @@

      Defines an attributes writer for the specified association(s).

      Supported options:

      -
      :allow_destroy +
      :allow_destroy

      If true, destroys any members from the attributes hash with a _destroy key and a value that evaluates to true (e.g. 1, ‘1’, true, or ‘true’). This option is false by default.

      -
      :reject_if +
      :reject_if

      Allows you to specify a Proc or a Symbol pointing to a method that checks whether a record should be built for a certain attribute hash. The hash is passed to the supplied Proc or the method and it should return either true or false. When no :reject_if is specified, a record will be built for all attribute hashes that do not have a _destroy value that evaluates to true. Passing :all_blank instead of a Proc will create a proc that will reject a record where all the attributes are blank excluding any value for _destroy.

      -
      :limit +
      :limit

      Allows you to specify the maximum number of associated records that can be processed with the nested attributes. Limit also can be specified as a Proc or a Symbol pointing to a method that should return a number. If the size of the nested attributes array exceeds the specified limit, NestedAttributes::TooManyRecords exception is raised. If omitted, any number of associations can be processed. Note that the :limit option is only applicable to one-to-many associations.

      -
      :update_only +
      :update_only

      For a one-to-one association, this option allows you to specify how nested attributes are going to be used when an associated record already exists. In general, an existing record may either be updated with the new set of attribute values or be replaced by a wholly new record containing those values. By default the :update_only option is false and the nested attributes are used to update the existing record only if they include the record’s :id value. Otherwise a new record will be instantiated and used to replace the existing one. However if the :update_only option is true, the nested attributes are used to update the record’s attributes always, regardless of whether the :id is present. The option is ignored for collection associations.

      diff --git a/src/7.2/classes/ActiveRecord/Persistence.html b/src/7.2/classes/ActiveRecord/Persistence.html index b4b60bf1c7..64981b79ca 100644 --- a/src/7.2/classes/ActiveRecord/Persistence.html +++ b/src/7.2/classes/ActiveRecord/Persistence.html @@ -185,7 +185,7 @@

      -

      Returns an instance of the specified klass with the attributes of the current record. This is mostly useful in relation to single table inheritance (STI) structures where you want a subclass to appear as the superclass. This can be used along with record identification in Action Pack to allow, say, Client < Company to do something like render partial: @client.becomes(Company) to render that instance using the companies/company partial instead of clients/client.

      +

      Returns an instance of the specified klass with the attributes of the current record. This is mostly useful in relation to single table inheritance (STI) structures where you want a subclass to appear as the superclass. This can be used along with record identification in Action Pack to allow, say, Client < Company to do something like render client.becomes(Company) at partial: to render that instance using the companies/company partial instead of clients/client.

      Note: The new instance will share a link to the same attributes as the original class. Therefore the STI column value will still be the same. Any change to the attributes on either instance will affect both instances. This includes any attribute initialization done by the new instance.

      diff --git a/src/7.2/classes/ActiveRecord/Persistence/ClassMethods.html b/src/7.2/classes/ActiveRecord/Persistence/ClassMethods.html index daaf621f95..71a002d791 100644 --- a/src/7.2/classes/ActiveRecord/Persistence/ClassMethods.html +++ b/src/7.2/classes/ActiveRecord/Persistence/ClassMethods.html @@ -295,7 +295,7 @@

      -

      Accepts a list of attribute names to be used in the WHERE clause of SELECT / UPDATE / DELETE queries and in the ORDER BY clause for #first and #last finder methods.

      +

      Accepts a list of attribute names to be used in the WHERE clause of SELECT / UPDATE / DELETE queries and in the ORDER BY clause for first and last finder methods.

      class Developer < ActiveRecord::Base
         query_constraints :company_id, :id
      diff --git a/src/7.2/classes/ActiveRecord/Promise.html b/src/7.2/classes/ActiveRecord/Promise.html
      index 550ebd1ea5..de888ef239 100644
      --- a/src/7.2/classes/ActiveRecord/Promise.html
      +++ b/src/7.2/classes/ActiveRecord/Promise.html
      @@ -117,7 +117,7 @@ 

      -

      Returns a new ActiveRecord::Promise that will apply the passed block when the value is accessed:

      +

      Returns a new ActiveRecord::Promise that will apply the passed block when the value is accessed:

      Post.async_pick(:title).then { |title| title.upcase }.value
       # => "POST TITLE"
      @@ -156,7 +156,7 @@ 

      -

      Returns the query result. If the query wasn’t completed yet, accessing #value will block until the query completes. If the query failed, #value will raise the corresponding error.

      +

      Returns the query result. If the query wasn’t completed yet, accessing value will block until the query completes. If the query failed, value will raise the corresponding error.

      diff --git a/src/7.2/classes/ActiveRecord/QueryLogs.html b/src/7.2/classes/ActiveRecord/QueryLogs.html index 18d4cc88e0..8d23ae0a3e 100644 --- a/src/7.2/classes/ActiveRecord/QueryLogs.html +++ b/src/7.2/classes/ActiveRecord/QueryLogs.html @@ -68,7 +68,7 @@

      Active Re

      job

    -

    New comment tags can be defined by adding them in a Hash to the tags Array. Tags can have dynamic content by setting a Proc or lambda value in the Hash, and can reference any value stored by Rails in the context object. ActiveSupport::CurrentAttributes can be used to store application values. Tags with nil values are omitted from the query comment.

    +

    New comment tags can be defined by adding them in a Hash to the tags Array. Tags can have dynamic content by setting a Proc or lambda value in the Hash, and can reference any value stored by Rails in the context object. ActiveSupport::CurrentAttributes can be used to store application values. Tags with nil values are omitted from the query comment.

    Escaping is performed on the string returned, however untrusted user input should not be used.

    diff --git a/src/7.2/classes/ActiveRecord/QueryMethods.html b/src/7.2/classes/ActiveRecord/QueryMethods.html index e1352c3e5b..5647f085f2 100644 --- a/src/7.2/classes/ActiveRecord/QueryMethods.html +++ b/src/7.2/classes/ActiveRecord/QueryMethods.html @@ -541,7 +541,7 @@

    # SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = 1 AND "comments"."id" != 2

    -

    This is short-hand for .where.not(id: post.id) and .where.not(id: [post_one.id, post_two.id]).

    +

    This is short-hand for .where.not(id: post.id) and .where.not(id: [post_one.id, post_two.id]).

    An ArgumentError will be raised if either no records are specified, or if any of the records in the collection (if a collection is passed in) are not instances of the same model that the relation is scoping.

    @@ -1075,7 +1075,7 @@

    # WHERE NOT (`accepted` = 1 AND `locked` = 0)

    -

    Be careful because this inverts all conditions before invert_where call.

    +

    Be careful because this inverts all conditions before invert_where call.

    class User
       scope :active, -> { where(accepted: true, locked: false) }
    @@ -2482,7 +2482,7 @@ 

    # SELECT * FROM posts JOIN posts_with_tags ON posts_with_tags.id = posts.id

    -

    It is recommended to pass a query as ActiveRecord::Relation. If that is not possible and you have verified it is safe for the database, you can pass it as SQL literal using Arel.

    +

    It is recommended to pass a query as ActiveRecord::Relation. If that is not possible and you have verified it is safe for the database, you can pass it as SQL literal using Arel.

    Post.with(popular_posts: Arel.sql("... complex sql to calculate posts popularity ..."))
     
    diff --git a/src/7.2/classes/ActiveRecord/QueryMethods/WhereChain.html b/src/7.2/classes/ActiveRecord/QueryMethods/WhereChain.html index 112306a4e6..0a6d912375 100644 --- a/src/7.2/classes/ActiveRecord/QueryMethods/WhereChain.html +++ b/src/7.2/classes/ActiveRecord/QueryMethods/WhereChain.html @@ -29,7 +29,7 @@

    -

    WhereChain objects act as placeholder for queries in which where does not have any parameter. In this case, where can be chained to return a new relation.

    +

    WhereChain objects act as placeholder for queries in which where does not have any parameter. In this case, where can be chained to return a new relation.

    diff --git a/src/7.2/classes/ActiveRecord/Querying.html b/src/7.2/classes/ActiveRecord/Querying.html index 727a5b7f0c..c787493c48 100644 --- a/src/7.2/classes/ActiveRecord/Querying.html +++ b/src/7.2/classes/ActiveRecord/Querying.html @@ -78,7 +78,7 @@

    -

    Same as #count_by_sql but perform the query asynchronously and returns an ActiveRecord::Promise.

    +

    Same as count_by_sql but perform the query asynchronously and returns an ActiveRecord::Promise.

    @@ -115,7 +115,7 @@

    -

    Same as #find_by_sql but perform the query asynchronously and returns an ActiveRecord::Promise.

    +

    Same as find_by_sql but perform the query asynchronously and returns an ActiveRecord::Promise.

    diff --git a/src/7.2/classes/ActiveRecord/Reflection/MacroReflection.html b/src/7.2/classes/ActiveRecord/Reflection/MacroReflection.html index f663b6fdc9..40ec84cb08 100644 --- a/src/7.2/classes/ActiveRecord/Reflection/MacroReflection.html +++ b/src/7.2/classes/ActiveRecord/Reflection/MacroReflection.html @@ -185,7 +185,7 @@

    -

    Returns true if self and other_aggregation have the same name attribute, active_record attribute, and other_aggregation has an options hash assigned to it.

    +

    Returns true if self and other_aggregation have the same name attribute, active_record attribute, and other_aggregation has an options hash assigned to it.

    diff --git a/src/7.2/classes/ActiveRecord/Relation.html b/src/7.2/classes/ActiveRecord/Relation.html index 95bb5815d3..449f1d416d 100644 --- a/src/7.2/classes/ActiveRecord/Relation.html +++ b/src/7.2/classes/ActiveRecord/Relation.html @@ -1708,12 +1708,12 @@

    Returns an ActiveRecord::Result with its contents based on :returning (see below).

    Options

    -
    :returning +
    :returning

    (PostgreSQL, SQLite3, and MariaDB only) An array of attributes to return for all successfully inserted records, which by default is the primary key. Pass returning: %w[ id name ] for both id and name or returning: false to omit the underlying RETURNING SQL clause entirely.

    -

    You can also pass an SQL string if you need more control on the return values (for example, returning: Arel.sql("id, name as new_name")).

    -
    :unique_by +

    You can also pass an SQL string if you need more control on the return values (for example, returning: Arel.sql("id, name as new_name")).

    +
    :unique_by

    (PostgreSQL and SQLite only) By default rows are considered to be unique by every unique index on the table. Any duplicate rows are skipped.

    @@ -1727,7 +1727,7 @@

    Options

    unique_by: %i[ author_id name ] unique_by: :index_books_on_isbn

    -
    :record_timestamps +
    :record_timestamps

    By default, automatic setting of timestamp columns is controlled by the model’s record_timestamps config, matching typical behavior.

    @@ -1803,12 +1803,12 @@

    Returns an ActiveRecord::Result with its contents based on :returning (see below).

    Options

    -
    :returning +
    :returning

    (PostgreSQL, SQLite3, and MariaDB only) An array of attributes to return for all successfully inserted records, which by default is the primary key. Pass returning: %w[ id name ] for both id and name or returning: false to omit the underlying RETURNING SQL clause entirely.

    -

    You can also pass an SQL string if you need more control on the return values (for example, returning: Arel.sql("id, name as new_name")).

    -
    :record_timestamps +

    You can also pass an SQL string if you need more control on the return values (for example, returning: Arel.sql("id, name as new_name")).

    +
    :record_timestamps

    By default, automatic setting of timestamp columns is controlled by the model’s record_timestamps config, matching typical behavior.

    @@ -1991,11 +1991,11 @@

    Post.where(published: true).load_async # => #<ActiveRecord::Relation>
     
    -

    When the Relation is iterated, if the background query wasn’t executed yet, it will be performed by the foreground thread.

    +

    When the Relation is iterated, if the background query wasn’t executed yet, it will be performed by the foreground thread.

    Note that config.active_record.async_query_executor must be configured for queries to actually be executed concurrently. Otherwise it defaults to executing them in the foreground.

    -

    load_async will also fall back to executing in the foreground in the test environment when transactional fixtures are enabled.

    +

    load_async will also fall back to executing in the foreground in the test environment when transactional fixtures are enabled.

    If the query was actually executed in the background, the Active Record logs will show it by prefixing the log line with ASYNC:

    @@ -2686,7 +2686,7 @@

    Parameters

    • -

      updates - A string, array, or hash representing the SET part of an SQL statement. Any strings provided will be type cast, unless you use Arel.sql. (Don’t pass user-provided values to Arel.sql.)

      +

      updates - A string, array, or hash representing the SET part of an SQL statement. Any strings provided will be type cast, unless you use Arel.sql. (Don’t pass user-provided values to Arel.sql.)

    Examples

    @@ -2878,15 +2878,15 @@

    Returns an ActiveRecord::Result with its contents based on :returning (see below).

    -

    By default, upsert_all will update all the columns that can be updated when there is a conflict. These are all the columns except primary keys, read-only columns, and columns covered by the optional unique_by.

    +

    By default, upsert_all will update all the columns that can be updated when there is a conflict. These are all the columns except primary keys, read-only columns, and columns covered by the optional unique_by.

    Options

    -
    :returning +
    :returning

    (PostgreSQL, SQLite3, and MariaDB only) An array of attributes to return for all successfully inserted records, which by default is the primary key. Pass returning: %w[ id name ] for both id and name or returning: false to omit the underlying RETURNING SQL clause entirely.

    -

    You can also pass an SQL string if you need more control on the return values (for example, returning: Arel.sql("id, name as new_name")).

    -
    :unique_by +

    You can also pass an SQL string if you need more control on the return values (for example, returning: Arel.sql("id, name as new_name")).

    +
    :unique_by

    (PostgreSQL and SQLite only) By default rows are considered to be unique by every unique index on the table. Any duplicate rows are skipped.

    @@ -2903,7 +2903,7 @@

    Options

    Because it relies on the index information from the database :unique_by is recommended to be paired with Active Record’s schema_cache.

    -
    :on_duplicate +
    :on_duplicate

    Configure the SQL update sentence that will be used in case of conflict.

    @@ -2922,9 +2922,9 @@

    Options

    See the related :update_only option. Both options can’t be used at the same time.

    -
    :update_only +
    :update_only
    -

    Provide a list of column names that will be updated in case of conflict. If not provided, upsert_all will update all the columns that can be updated. These are all the columns except primary keys, read-only columns, and columns covered by the optional unique_by

    +

    Provide a list of column names that will be updated in case of conflict. If not provided, upsert_all will update all the columns that can be updated. These are all the columns except primary keys, read-only columns, and columns covered by the optional unique_by

    Example:

    @@ -2939,7 +2939,7 @@

    Options

    See the related :on_duplicate option. Both options can’t be used at the same time.

    -
    :record_timestamps +
    :record_timestamps

    By default, automatic setting of timestamp columns is controlled by the model’s record_timestamps config, matching typical behavior.

    diff --git a/src/7.2/classes/ActiveRecord/Scoping/Default/ClassMethods.html b/src/7.2/classes/ActiveRecord/Scoping/Default/ClassMethods.html index dcc7fffbca..a634517830 100644 --- a/src/7.2/classes/ActiveRecord/Scoping/Default/ClassMethods.html +++ b/src/7.2/classes/ActiveRecord/Scoping/Default/ClassMethods.html @@ -206,7 +206,7 @@

    # DELETE ... FROM `articles` where ID = 1 AND blog_id = 1; -

    (You can also pass any object which responds to call to the default_scope macro, and it will be called when building the default scope.)

    +

    (You can also pass any object which responds to call to the default_scope macro, and it will be called when building the default scope.)

    If you use multiple default_scope declarations in your model then they will be merged together:

    diff --git a/src/7.2/classes/ActiveRecord/SecurePassword/ClassMethods.html b/src/7.2/classes/ActiveRecord/SecurePassword/ClassMethods.html index 026f2841f4..728cd1ca11 100644 --- a/src/7.2/classes/ActiveRecord/SecurePassword/ClassMethods.html +++ b/src/7.2/classes/ActiveRecord/SecurePassword/ClassMethods.html @@ -68,7 +68,7 @@

    Given a set of attributes, finds a record using the non-password attributes, and then authenticates that record using the password attributes. Returns the record if authentication succeeds; otherwise, returns nil.

    -

    Regardless of whether a record is found, authenticate_by will cryptographically digest the given password attributes. This behavior helps mitigate timing-based enumeration attacks, wherein an attacker can determine if a passworded record exists even without knowing the password.

    +

    Regardless of whether a record is found, authenticate_by will cryptographically digest the given password attributes. This behavior helps mitigate timing-based enumeration attacks, wherein an attacker can determine if a passworded record exists even without knowing the password.

    Raises an ArgumentError if the set of attributes doesn’t contain at least one password and one non-password attribute.

    diff --git a/src/7.2/classes/ActiveRecord/SecureToken/ClassMethods.html b/src/7.2/classes/ActiveRecord/SecureToken/ClassMethods.html index a699f87cd3..229d14de6e 100644 --- a/src/7.2/classes/ActiveRecord/SecureToken/ClassMethods.html +++ b/src/7.2/classes/ActiveRecord/SecureToken/ClassMethods.html @@ -121,15 +121,15 @@

    user.regenerate_auth_token # => true -

    SecureRandom::base58 is used to generate at minimum a 24-character unique token, so collisions are highly unlikely.

    +

    SecureRandom::base58 is used to generate at minimum a 24-character unique token, so collisions are highly unlikely.

    Note that it’s still possible to generate a race condition in the database in the same way that validates_uniqueness_of can. You’re encouraged to add a unique index in the database to deal with this even more unlikely scenario.

    Options

    -
    :length +
    :length

    Length of the Secure Random, with a minimum of 24 characters. It will default to 24.

    -
    :on +

    :on

    The callback when the value is generated. When called with on: :initialize, the value is generated in an after_initialize callback, otherwise the value will be used in a before_ callback. When not specified, :on will use the value of config.active_record.generate_secure_token_on, which defaults to :initialize starting in Rails 7.1.

    diff --git a/src/7.2/classes/ActiveRecord/SignedId.html b/src/7.2/classes/ActiveRecord/SignedId.html index 6ea68e329d..f7d47d7dcd 100644 --- a/src/7.2/classes/ActiveRecord/SignedId.html +++ b/src/7.2/classes/ActiveRecord/SignedId.html @@ -126,9 +126,9 @@

    -

    Returns a signed id that’s generated using a preconfigured ActiveSupport::MessageVerifier instance.

    +

    Returns a signed id that’s generated using a preconfigured ActiveSupport::MessageVerifier instance.

    -

    This signed id is tamper proof, so it’s safe to send in an email or otherwise share with the outside world. However, as with any message signed with a ActiveSupport::MessageVerifier, the signed id is not encrypted. It’s just encoded and protected against tampering.

    +

    This signed id is tamper proof, so it’s safe to send in an email or otherwise share with the outside world. However, as with any message signed with a ActiveSupport::MessageVerifier, the signed id is not encrypted. It’s just encoded and protected against tampering.

    This means that the ID can be decoded by anyone; however, if tampered with (so to point to a different ID), the cryptographic signature will no longer match, and the signed id will be considered invalid and return nil when passed to find_signed (or raise with find_signed!).

    diff --git a/src/7.2/classes/ActiveRecord/SignedId/ClassMethods.html b/src/7.2/classes/ActiveRecord/SignedId/ClassMethods.html index c9f47e174a..3a550801a5 100644 --- a/src/7.2/classes/ActiveRecord/SignedId/ClassMethods.html +++ b/src/7.2/classes/ActiveRecord/SignedId/ClassMethods.html @@ -134,7 +134,7 @@

    -

    Works like find_signed, but will raise an ActiveSupport::MessageVerifier::InvalidSignature exception if the signed_id has either expired, has a purpose mismatch, is for another record, or has been tampered with. It will also raise an ActiveRecord::RecordNotFound exception if the valid signed id can’t find a record.

    +

    Works like find_signed, but will raise an ActiveSupport::MessageVerifier::InvalidSignature exception if the signed_id has either expired, has a purpose mismatch, is for another record, or has been tampered with. It will also raise an ActiveRecord::RecordNotFound exception if the valid signed id can’t find a record.

    Examples

    @@ -224,7 +224,7 @@

    -

    Allows you to pass in a custom verifier used for the signed ids. This also allows you to use different verifiers for different classes. This is also helpful if you need to rotate keys, as you can prepare your custom verifier for that in advance. See ActiveSupport::MessageVerifier for details.

    +

    Allows you to pass in a custom verifier used for the signed ids. This also allows you to use different verifiers for different classes. This is also helpful if you need to rotate keys, as you can prepare your custom verifier for that in advance. See ActiveSupport::MessageVerifier for details.

    diff --git a/src/7.2/classes/ActiveRecord/Tasks/DatabaseTasks.html b/src/7.2/classes/ActiveRecord/Tasks/DatabaseTasks.html index 2aa1417c86..17d26ffa91 100644 --- a/src/7.2/classes/ActiveRecord/Tasks/DatabaseTasks.html +++ b/src/7.2/classes/ActiveRecord/Tasks/DatabaseTasks.html @@ -35,15 +35,15 @@

    Rails.env).

  • -

    database_configuration: configuration of your databases (as in config/database.yml).

    +

    database_configuration: configuration of your databases (as in config/database.yml).

  • -

    db_dir: your db directory.

    +

    db_dir: your db directory.

  • -

    fixtures_path: a path to fixtures directory.

    +

    fixtures_path: a path to fixtures directory.

  • -

    migrations_paths: a list of paths to directories with migrations.

    +

    migrations_paths: a list of paths to directories with migrations.

  • -

    seed_loader: an object which will load seeds, it needs to respond to the load_seed method.

    +

    seed_loader: an object which will load seeds, it needs to respond to the load_seed method.

  • root: a path to the root of the application.

  • diff --git a/src/7.2/classes/ActiveRecord/Timestamp.html b/src/7.2/classes/ActiveRecord/Timestamp.html index 0f535ab59d..da4b9ba657 100644 --- a/src/7.2/classes/ActiveRecord/Timestamp.html +++ b/src/7.2/classes/ActiveRecord/Timestamp.html @@ -39,7 +39,7 @@

    Active Rec

    Time Zone aware attributes

    -

    Active Record keeps all the datetime and time columns timezone aware. By default, these values are stored in the database as UTC and converted back to the current Time.zone when pulled from the database.

    +

    Active Record keeps all the datetime and time columns timezone aware. By default, these values are stored in the database as UTC and converted back to the current Time.zone when pulled from the database.

    This feature can be turned off completely by setting:

    diff --git a/src/7.2/classes/ActiveRecord/Transactions/ClassMethods.html b/src/7.2/classes/ActiveRecord/Transactions/ClassMethods.html index df285097e8..f0f648ba20 100644 --- a/src/7.2/classes/ActiveRecord/Transactions/ClassMethods.html +++ b/src/7.2/classes/ActiveRecord/Transactions/ClassMethods.html @@ -166,7 +166,7 @@

    after_create_commit and after_update_commit, but will not be deduplicated.

    Caveats

    diff --git a/src/7.2/classes/ActiveRecord/Validations/ClassMethods.html b/src/7.2/classes/ActiveRecord/Validations/ClassMethods.html index ebab65d122..491ea8acd8 100644 --- a/src/7.2/classes/ActiveRecord/Validations/ClassMethods.html +++ b/src/7.2/classes/ActiveRecord/Validations/ClassMethods.html @@ -236,7 +236,7 @@

    -

    Validates whether the value of the specified attribute is numeric by trying to convert it to a float with Kernel.Float (if only_integer is false) or applying it to the regular expression /\A[+\-]?\d+\z/ (if only_integer is set to true). Kernel.Float precision defaults to the column’s precision value or 15.

    +

    Validates whether the value of the specified attribute is numeric by trying to convert it to a float with Kernel.Float (if only_integer is false) or applying it to the regular expression /\A[+\-]?\d+\z/ (if only_integer is set to true). Kernel.Float precision defaults to the column’s precision value or 15.

    See ActiveModel::Validations::HelperMethods.validates_numericality_of for more information.

    diff --git a/src/7.2/classes/ActiveStorage.html b/src/7.2/classes/ActiveStorage.html index 6af78d241d..5f85d17148 100644 --- a/src/7.2/classes/ActiveStorage.html +++ b/src/7.2/classes/ActiveStorage.html @@ -193,9 +193,9 @@

    Active Storage

    Compared to other storage solutions

    -

    A key difference to how Active Storage works compared to other attachment solutions in Rails is through the use of built-in Blob and Attachment models (backed by Active Record). This means existing application models do not need to be modified with additional columns to associate with files. Active Storage uses polymorphic associations via the Attachment join model, which then connects to the actual Blob.

    +

    A key difference to how Active Storage works compared to other attachment solutions in Rails is through the use of built-in Blob and Attachment models (backed by Active Record). This means existing application models do not need to be modified with additional columns to associate with files. Active Storage uses polymorphic associations via the Attachment join model, which then connects to the actual Blob.

    -

    Blob models store attachment metadata (filename, content-type, etc.), and their identifier key in the storage service. Blob models do not store the actual binary data. They are intended to be immutable in spirit. One file, one blob. You can associate the same blob with multiple application models as well. And if you want to do transformations of a given Blob, the idea is that you’ll simply create a new one, rather than attempt to mutate the existing one (though of course you can delete the previous version later if you don’t need it).

    +

    Blob models store attachment metadata (filename, content-type, etc.), and their identifier key in the storage service. Blob models do not store the actual binary data. They are intended to be immutable in spirit. One file, one blob. You can associate the same blob with multiple application models as well. And if you want to do transformations of a given Blob, the idea is that you’ll simply create a new one, rather than attempt to mutate the existing one (though of course you can delete the previous version later if you don’t need it).

    Installation

    diff --git a/src/7.2/classes/ActiveStorage/Attached/Model.html b/src/7.2/classes/ActiveStorage/Attached/Model.html index 6251908993..e60695e350 100644 --- a/src/7.2/classes/ActiveStorage/Attached/Model.html +++ b/src/7.2/classes/ActiveStorage/Attached/Model.html @@ -98,7 +98,7 @@

    -

    Returns the attachment for the has_one_attached.

    +

    Returns the attachment for the has_one_attached.

    User.last.avatar_attachment
     
    @@ -124,7 +124,7 @@

    -

    Returns the attachments for the has_many_attached.

    +

    Returns the attachments for the has_many_attached.

    Gallery.last.photos_attachments
     
    @@ -150,7 +150,7 @@

    -

    Returns the blob for the has_one_attached attachment.

    +

    Returns the blob for the has_one_attached attachment.

    User.last.avatar_blob
     
    @@ -176,7 +176,7 @@

    -

    Returns the blobs for the has_many_attached attachments.

    +

    Returns the blobs for the has_many_attached attachments.

    Gallery.last.photos_blobs
     
    @@ -218,7 +218,7 @@

    Under the covers, this relationship is implemented as a has_many association to a ActiveStorage::Attachment record and a has_many-through association to a ActiveStorage::Blob record. These associations are available as photos_attachments and photos_blobs. But you shouldn’t need to work with these associations directly in most circumstances.

    -

    The system has been designed to having you go through the ActiveStorage::Attached::Many proxy that provides the dynamic proxy to the associations and factory methods, like #attach.

    +

    The system has been designed to having you go through the ActiveStorage::Attached::Many proxy that provides the dynamic proxy to the associations and factory methods, like attach.

    The :dependent option defaults to :purge_later. This means the attachments will be purged (i.e. destroyed) in the background whenever the record is destroyed. If an ActiveJob::Backend queue adapter is not set in the application set it to purge instead.

    @@ -366,7 +366,7 @@

    end -

    Note: Active Storage relies on polymorphic associations, which in turn store class names in the database. When renaming classes that use has_one_attached, make sure to also update the class names in the active_storage_attachments.record_type polymorphic type column of the corresponding rows.

    +

    Note: Active Storage relies on polymorphic associations, which in turn store class names in the database. When renaming classes that use has_one_attached, make sure to also update the class names in the active_storage_attachments.record_type polymorphic type column of the corresponding rows.

    @@ -453,7 +453,7 @@

    User.with_attached_avatar
     
    -

    Use the plural form for has_many_attached:

    +

    Use the plural form for has_many_attached:

    Gallery.with_attached_photos
     
    diff --git a/src/7.2/classes/ActiveStorage/Attachment.html b/src/7.2/classes/ActiveStorage/Attachment.html index 2aca518982..389052ef48 100644 --- a/src/7.2/classes/ActiveStorage/Attachment.html +++ b/src/7.2/classes/ActiveStorage/Attachment.html @@ -207,7 +207,7 @@

    See ActiveStorage::Blob::Representable#preview for more information.

    -

    Raises an ArgumentError if transformations is a Symbol which is an unknown pre-defined variant of the attachment.

    +

    Raises an ArgumentError if transformations is a Symbol which is an unknown pre-defined variant of the attachment.

    @@ -367,7 +367,7 @@

    See ActiveStorage::Blob::Representable#representation for more information.

    -

    Raises an ArgumentError if transformations is a Symbol which is an unknown pre-defined variant of the attachment.

    +

    Raises an ArgumentError if transformations is a Symbol which is an unknown pre-defined variant of the attachment.

    @@ -415,7 +415,7 @@

    See ActiveStorage::Blob::Representable#variant for more information.

    -

    Raises an ArgumentError if transformations is a Symbol which is an unknown pre-defined variant of the attachment.

    +

    Raises an ArgumentError if transformations is a Symbol which is an unknown pre-defined variant of the attachment.

    diff --git a/src/7.2/classes/ActiveStorage/Blob.html b/src/7.2/classes/ActiveStorage/Blob.html index 7ad62ebab6..69e7f01568 100644 --- a/src/7.2/classes/ActiveStorage/Blob.html +++ b/src/7.2/classes/ActiveStorage/Blob.html @@ -41,9 +41,9 @@

    Active Storage Blob

    A blob is a record that contains the metadata about a file and a key for where that file resides on the service. Blobs can be created in two ways:

    1. -

      Ahead of the file being uploaded server-side to the service, via create_and_upload!. A rewindable io with the file contents must be available at the server for this operation.

      +

      Ahead of the file being uploaded server-side to the service, via create_and_upload!. A rewindable io with the file contents must be available at the server for this operation.

    2. -

      Ahead of the file being directly uploaded client-side to the service, via create_before_direct_upload!.

      +

      Ahead of the file being directly uploaded client-side to the service, via create_before_direct_upload!.

    The first option doesn’t require any client-side JavaScript integration, and can be used by any other back-end service that deals with files. The second option is faster, since you’re not using your own server as a staging point for uploads, and can work with deployments like Heroku that do not provide large amounts of disk space.

    @@ -415,7 +415,7 @@

    -

    Works like find_signed, but will raise an ActiveSupport::MessageVerifier::InvalidSignature exception if the signed_id has either expired, has a purpose mismatch, is for another record, or has been tampered with. It will also raise an ActiveRecord::RecordNotFound exception if the valid signed id can’t find a record.

    +

    Works like find_signed, but will raise an ActiveSupport::MessageVerifier::InvalidSignature exception if the signed_id has either expired, has a purpose mismatch, is for another record, or has been tampered with. It will also raise an ActiveRecord::RecordNotFound exception if the valid signed id can’t find a record.

    @@ -1036,7 +1036,7 @@

    -

    Returns a Hash of headers for service_url_for_direct_upload requests.

    +

    Returns a Hash of headers for service_url_for_direct_upload requests.

    @@ -1180,7 +1180,7 @@

    Prior to uploading, we compute the checksum, which is sent to the service for transit integrity validation. If the checksum does not match what the service receives, an exception will be raised. We also measure the size of the io and store that in byte_size on the blob record. The content type is automatically extracted from the io unless you specify a content_type and pass identify as false.

    -

    Normally, you do not have to call this method directly at all. Use the create_and_upload! class method instead. If you do use this method directly, make sure you are using it on a persisted Blob as otherwise another blob’s data might get overwritten on the service.

    +

    Normally, you do not have to call this method directly at all. Use the create_and_upload! class method instead. If you do use this method directly, make sure you are using it on a persisted Blob as otherwise another blob’s data might get overwritten on the service.

    diff --git a/src/7.2/classes/ActiveStorage/Blob/Analyzable.html b/src/7.2/classes/ActiveStorage/Blob/Analyzable.html index 7c6f0f1a08..f8ea91f61d 100644 --- a/src/7.2/classes/ActiveStorage/Blob/Analyzable.html +++ b/src/7.2/classes/ActiveStorage/Blob/Analyzable.html @@ -84,7 +84,7 @@

    To choose the analyzer for a blob, Active Storage calls accept? on each registered analyzer in order. It uses the first analyzer for which accept? returns true when given the blob. If no registered analyzer accepts the blob, no metadata is extracted from it.

    -

    In a Rails application, add or remove analyzers by manipulating Rails.application.config.active_storage.analyzers in an initializer:

    +

    In a Rails application, add or remove analyzers by manipulating Rails.application.config.active_storage.analyzers in an initializer:

    # Add a custom analyzer for Microsoft Office documents:
     Rails.application.config.active_storage.analyzers.append DOCXAnalyzer
    diff --git a/src/7.2/classes/ActiveStorage/Preview.html b/src/7.2/classes/ActiveStorage/Preview.html
    index 6b1150a32c..0006004d2a 100644
    --- a/src/7.2/classes/ActiveStorage/Preview.html
    +++ b/src/7.2/classes/ActiveStorage/Preview.html
    @@ -35,7 +35,7 @@ 

    Active Storag

    A previewer extracts a preview image from a blob. Active Storage provides previewers for videos and PDFs. ActiveStorage::Previewer::VideoPreviewer is used for videos whereas ActiveStorage::Previewer::PopplerPDFPreviewer and ActiveStorage::Previewer::MuPDFPreviewer are used for PDFs. Build custom previewers by subclassing ActiveStorage::Previewer and implementing the requisite methods. Consult the ActiveStorage::Previewer documentation for more details on what’s required of previewers.

    -

    To choose the previewer for a blob, Active Storage calls accept? on each registered previewer in order. It uses the first previewer for which accept? returns true when given the blob. In a Rails application, add or remove previewers by manipulating Rails.application.config.active_storage.previewers in an initializer:

    +

    To choose the previewer for a blob, Active Storage calls accept? on each registered previewer in order. It uses the first previewer for which accept? returns true when given the blob. In a Rails application, add or remove previewers by manipulating Rails.application.config.active_storage.previewers in an initializer:

    Rails.application.config.active_storage.previewers
     # => [ ActiveStorage::Previewer::PopplerPDFPreviewer, ActiveStorage::Previewer::MuPDFPreviewer, ActiveStorage::Previewer::VideoPreviewer ]
    @@ -304,7 +304,7 @@ 

    -

    Processes the preview if it has not been processed yet. Returns the receiving ActiveStorage::Preview instance for convenience:

    +

    Processes the preview if it has not been processed yet. Returns the receiving ActiveStorage::Preview instance for convenience:

    blob.preview(resize_to_limit: [100, 100]).processed.url
     
    diff --git a/src/7.2/classes/ActiveStorage/Service.html b/src/7.2/classes/ActiveStorage/Service.html index df09325fc8..71ee2ba1f3 100644 --- a/src/7.2/classes/ActiveStorage/Service.html +++ b/src/7.2/classes/ActiveStorage/Service.html @@ -464,7 +464,7 @@

    -

    Returns a Hash of headers for url_for_direct_upload requests.

    +

    Returns a Hash of headers for url_for_direct_upload requests.

    diff --git a/src/7.2/classes/ActiveStorage/Variation.html b/src/7.2/classes/ActiveStorage/Variation.html index 0ebae4fac1..66c8bfbf41 100644 --- a/src/7.2/classes/ActiveStorage/Variation.html +++ b/src/7.2/classes/ActiveStorage/Variation.html @@ -171,7 +171,7 @@

    -

    Returns a signed key for the transformations, which can be used to refer to a specific variation in a URL or combined key (like ActiveStorage::Variant#key).

    +

    Returns a signed key for the transformations, which can be used to refer to a specific variation in a URL or combined key (like ActiveStorage::Variant#key).

    diff --git a/src/7.2/classes/ActiveSupport/ActionableError.html b/src/7.2/classes/ActiveSupport/ActionableError.html index ea3126b99d..1fb1f7b3ad 100644 --- a/src/7.2/classes/ActiveSupport/ActionableError.html +++ b/src/7.2/classes/ActiveSupport/ActionableError.html @@ -27,7 +27,7 @@

    Actionabl

    Actionable errors lets you define actions to resolve an error.

    -

    To make an error actionable, include the ActiveSupport::ActionableError module and invoke the action class macro to define the action. An action needs a name and a block to execute.

    +

    To make an error actionable, include the ActiveSupport::ActionableError module and invoke the action class macro to define the action. An action needs a name and a block to execute.

    diff --git a/src/7.2/classes/ActiveSupport/ArrayInquirer.html b/src/7.2/classes/ActiveSupport/ArrayInquirer.html index 6f8d38b3d8..e064e1b4ed 100644 --- a/src/7.2/classes/ActiveSupport/ArrayInquirer.html +++ b/src/7.2/classes/ActiveSupport/ArrayInquirer.html @@ -31,7 +31,7 @@

    Array Inquirer

    -

    Wrapping an array in an ArrayInquirer gives a friendlier way to check its string-like contents:

    +

    Wrapping an array in an ArrayInquirer gives a friendlier way to check its string-like contents:

    variants = ActiveSupport::ArrayInquirer.new([:phone, :tablet])
     
    diff --git a/src/7.2/classes/ActiveSupport/Cache/FileStore.html b/src/7.2/classes/ActiveSupport/Cache/FileStore.html
    index 91c73a03bf..6398c4cae4 100644
    --- a/src/7.2/classes/ActiveSupport/Cache/FileStore.html
    +++ b/src/7.2/classes/ActiveSupport/Cache/FileStore.html
    @@ -265,7 +265,7 @@ 

    -

    Deletes all items from the cache. In this case it deletes all the entries in the specified file store directory except for .keep or .gitkeep. Be careful which directory is specified in your config file when using FileStore because everything in that directory will be deleted.

    +

    Deletes all items from the cache. In this case it deletes all the entries in the specified file store directory except for .keep or .gitkeep. Be careful which directory is specified in your config file when using FileStore because everything in that directory will be deleted.

    diff --git a/src/7.2/classes/ActiveSupport/Cache/MemCacheStore.html b/src/7.2/classes/ActiveSupport/Cache/MemCacheStore.html index 071e3e2a79..a26d9876d3 100644 --- a/src/7.2/classes/ActiveSupport/Cache/MemCacheStore.html +++ b/src/7.2/classes/ActiveSupport/Cache/MemCacheStore.html @@ -37,10 +37,10 @@

    M

    Special features:

    • -

      Clustering and load balancing. One can specify multiple memcached servers, and MemCacheStore will load balance between all available servers. If a server goes down, then MemCacheStore will ignore it until it comes back up.

      +

      Clustering and load balancing. One can specify multiple memcached servers, and MemCacheStore will load balance between all available servers. If a server goes down, then MemCacheStore will ignore it until it comes back up.

    -

    MemCacheStore implements the Strategy::LocalCache strategy which implements an in-memory cache inside of a block.

    +

    MemCacheStore implements the Strategy::LocalCache strategy which implements an in-memory cache inside of a block.

    @@ -148,12 +148,12 @@

    -

    Creates a new MemCacheStore object, with the given memcached server addresses. Each address is either a host name, or a host-with-port string in the form of “host_name:port”. For example:

    +

    Creates a new MemCacheStore object, with the given memcached server addresses. Each address is either a host name, or a host-with-port string in the form of “host_name:port”. For example:

    ActiveSupport::Cache::MemCacheStore.new("localhost", "server-downstairs.localnetwork:8229")
     
    -

    If no addresses are provided, but ENV['MEMCACHE_SERVERS'] is defined, it will be used instead. Otherwise, MemCacheStore will connect to localhost:11211 (the default memcached port).

    +

    If no addresses are provided, but ENV['MEMCACHE_SERVERS'] is defined, it will be used instead. Otherwise, MemCacheStore will connect to localhost:11211 (the default memcached port).

    diff --git a/src/7.2/classes/ActiveSupport/Cache/MemoryStore.html b/src/7.2/classes/ActiveSupport/Cache/MemoryStore.html index adcd9b56e5..ad0d3a44b0 100644 --- a/src/7.2/classes/ActiveSupport/Cache/MemoryStore.html +++ b/src/7.2/classes/ActiveSupport/Cache/MemoryStore.html @@ -35,9 +35,9 @@

    Memory

    This cache has a bounded size specified by the :size options to the initializer (default is 32Mb). When the cache exceeds the allotted size, a cleanup will occur which tries to prune the cache down to three quarters of the maximum size by removing the least recently used entries.

    -

    Unlike other Cache store implementations, MemoryStore does not compress values by default. MemoryStore does not benefit from compression as much as other Store implementations, as it does not send data over a network. However, when compression is enabled, it still pays the full cost of compression in terms of cpu use.

    +

    Unlike other Cache store implementations, MemoryStore does not compress values by default. MemoryStore does not benefit from compression as much as other Store implementations, as it does not send data over a network. However, when compression is enabled, it still pays the full cost of compression in terms of cpu use.

    -

    MemoryStore is thread-safe.

    +

    MemoryStore is thread-safe.

    diff --git a/src/7.2/classes/ActiveSupport/Cache/RedisCacheStore.html b/src/7.2/classes/ActiveSupport/Cache/RedisCacheStore.html index 246039bf2e..54847e3991 100644 --- a/src/7.2/classes/ActiveSupport/Cache/RedisCacheStore.html +++ b/src/7.2/classes/ActiveSupport/Cache/RedisCacheStore.html @@ -43,9 +43,9 @@

    Red
  • Local cache. Hot in-memory primary cache within block/middleware scope.

  • -

    read_multi and write_multi support for Redis mget/mset. Use Redis::Distributed 4.0.1+ for distributed mget support.

    +

    read_multi and write_multi support for Redis mget/mset. Use Redis::Distributed 4.0.1+ for distributed mget support.

  • -

    delete_matched support for Redis KEYS globs.

    +

    delete_matched support for Redis KEYS globs.

  • diff --git a/src/7.2/classes/ActiveSupport/Cache/Store.html b/src/7.2/classes/ActiveSupport/Cache/Store.html index 60b8fac5ee..3bae2fc8ea 100644 --- a/src/7.2/classes/ActiveSupport/Cache/Store.html +++ b/src/7.2/classes/ActiveSupport/Cache/Store.html @@ -35,7 +35,7 @@

    Acti

    Some implementations may not support all methods beyond the basic cache methods of fetch, write, read, exist?, and delete.

    -

    ActiveSupport::Cache::Store can store any Ruby object that is supported by its coder‘s dump and load methods.

    +

    ActiveSupport::Cache::Store can store any Ruby object that is supported by its coder‘s dump and load methods.

    cache = ActiveSupport::Cache::MemoryStore.new
     
    @@ -206,17 +206,17 @@ 

    Creates a new cache.

    Options

    -
    :namespace +
    :namespace

    Sets the namespace for the cache. This option is especially useful if your application shares a cache with other applications.

    -
    :serializer +
    :serializer

    The serializer for cached values. Must respond to dump and load.

    The default serializer depends on the cache format version (set via config.active_support.cache_format_version when using Rails). The default serializer for each format version includes a fallback mechanism to deserialize values from any format version. This behavior makes it easy to migrate between format versions without invalidating the entire cache.

    You can also specify serializer: :message_pack to use a preconfigured serializer based on ActiveSupport::MessagePack. The :message_pack serializer includes the same deserialization fallback mechanism, allowing easy migration from (or to) the default serializer. The :message_pack serializer may improve performance, but it requires the msgpack gem.

    -
    :compressor +
    :compressor

    The compressor for serialized cache values. Must respond to deflate and inflate.

    @@ -238,7 +238,7 @@

    Options

    ActiveSupport::Cache.lookup_store(:redis_cache_store, compressor: MyCompressor)
    -
    :coder +
    :coder

    The coder for serializing and (optionally) compressing cache entries. Must respond to dump and load.

    diff --git a/src/7.2/classes/ActiveSupport/Cache/WriteOptions.html b/src/7.2/classes/ActiveSupport/Cache/WriteOptions.html index 1ee87ec74b..a1c68dc949 100644 --- a/src/7.2/classes/ActiveSupport/Cache/WriteOptions.html +++ b/src/7.2/classes/ActiveSupport/Cache/WriteOptions.html @@ -29,7 +29,7 @@

    -

    Enables the dynamic configuration of Cache entry options while ensuring that conflicting options are not both set. When a block is given to ActiveSupport::Cache::Store#fetch, the second argument will be an instance of WriteOptions.

    +

    Enables the dynamic configuration of Cache entry options while ensuring that conflicting options are not both set. When a block is given to ActiveSupport::Cache::Store#fetch, the second argument will be an instance of WriteOptions.

    @@ -133,7 +133,7 @@

    -

    Sets the Cache entry’s expires_at value. If an expires_in option was previously set, this will unset it since expires_at and expires_in cannot both be set.

    +

    Sets the Cache entry’s expires_at value. If an expires_in option was previously set, this will unset it since expires_at and expires_in cannot both be set.

    @@ -204,7 +204,7 @@

    -

    Sets the Cache entry’s expires_in value. If an expires_at option was previously set, this will unset it since expires_in and expires_at cannot both be set.

    +

    Sets the Cache entry’s expires_in value. If an expires_at option was previously set, this will unset it since expires_in and expires_at cannot both be set.

    diff --git a/src/7.2/classes/ActiveSupport/Callbacks.html b/src/7.2/classes/ActiveSupport/Callbacks.html index 34f9feebf4..c7c6013023 100644 --- a/src/7.2/classes/ActiveSupport/Callbacks.html +++ b/src/7.2/classes/ActiveSupport/Callbacks.html @@ -27,7 +27,7 @@

    Active S

    Callbacks are code hooks that are run at key points in an object’s life cycle. The typical use case is to have a base class define a set of callbacks relevant to the other functionality it supplies, so that subclasses can install callbacks that enhance or modify the base functionality without needing to override or redefine methods of the base class.

    -

    Mixing in this module allows you to define the events in the object’s life cycle that will support callbacks (via ClassMethods#define_callbacks), set the instance methods, procs, or callback objects to be called (via ClassMethods#set_callback), and run the installed callbacks at the appropriate times (via run_callbacks).

    +

    Mixing in this module allows you to define the events in the object’s life cycle that will support callbacks (via ClassMethods#define_callbacks), set the instance methods, procs, or callback objects to be called (via ClassMethods#set_callback), and run the installed callbacks at the appropriate times (via run_callbacks).

    By default callbacks are halted by throwing :abort. See ClassMethods#define_callbacks for details.

    diff --git a/src/7.2/classes/ActiveSupport/Callbacks/ClassMethods.html b/src/7.2/classes/ActiveSupport/Callbacks/ClassMethods.html index 51233f3327..e4e383ea7e 100644 --- a/src/7.2/classes/ActiveSupport/Callbacks/ClassMethods.html +++ b/src/7.2/classes/ActiveSupport/Callbacks/ClassMethods.html @@ -140,9 +140,9 @@

    Options
    Notes
    -

    names passed to define_callbacks must not end with !, ? or =.

    +

    names passed to define_callbacks must not end with !, ? or =.

    -

    Calling define_callbacks multiple times with the same names will overwrite previous callbacks registered with set_callback.

    +

    Calling define_callbacks multiple times with the same names will overwrite previous callbacks registered with set_callback.

    @@ -324,7 +324,7 @@

    Skip a previously set callback. Like set_callback, :if or :unless options may be passed in order to control when the callback is skipped.

    -

    Note: this example uses PersonRecord and #saving_message, which you can see defined here

    +

    Note: this example uses PersonRecord and saving_message, which you can see defined here

    class Writer < PersonRecord
       attr_accessor :age
    diff --git a/src/7.2/classes/ActiveSupport/Concern.html b/src/7.2/classes/ActiveSupport/Concern.html
    index e04cfb3e55..d49d6aa3af 100644
    --- a/src/7.2/classes/ActiveSupport/Concern.html
    +++ b/src/7.2/classes/ActiveSupport/Concern.html
    @@ -41,7 +41,7 @@ 

    Active Suppo end

    -

    By using ActiveSupport::Concern the above module could instead be written as:

    +

    By using ActiveSupport::Concern the above module could instead be written as:

    require "active_support/concern"
     
    @@ -96,7 +96,7 @@ 

    Active Suppo end

    -

    Unfortunately this won’t work, since when Foo is included, its base is the Bar module, not the Host class. With ActiveSupport::Concern, module dependencies are properly resolved:

    +

    Unfortunately this won’t work, since when Foo is included, its base is the Bar module, not the Host class. With ActiveSupport::Concern, module dependencies are properly resolved:

    require "active_support/concern"
     
    diff --git a/src/7.2/classes/ActiveSupport/Concurrency/ShareLock.html b/src/7.2/classes/ActiveSupport/Concurrency/ShareLock.html
    index ff204977f9..9e2c912a5c 100644
    --- a/src/7.2/classes/ActiveSupport/Concurrency/ShareLock.html
    +++ b/src/7.2/classes/ActiveSupport/Concurrency/ShareLock.html
    @@ -168,7 +168,7 @@ 

    Execute the supplied block while holding the Exclusive lock. If no_wait is set and the lock is not immediately available, returns nil without yielding. Otherwise, returns the result of the block.

    -

    See start_exclusive for other options.

    +

    See start_exclusive for other options.

    diff --git a/src/7.2/classes/ActiveSupport/CurrentAttributes.html b/src/7.2/classes/ActiveSupport/CurrentAttributes.html index f497b71e8d..3379af7661 100644 --- a/src/7.2/classes/ActiveSupport/CurrentAttributes.html +++ b/src/7.2/classes/ActiveSupport/CurrentAttributes.html @@ -243,7 +243,7 @@

    Options

    :default - The default value for the attributes. If the value

    -

    is a proc or lambda, it will be called whenever an instance is constructed. Otherwise, the value will be duplicated with #dup. Default values are re-assigned when the attributes are reset.

    +

    is a proc or lambda, it will be called whenever an instance is constructed. Otherwise, the value will be duplicated with dup. Default values are re-assigned when the attributes are reset.

    diff --git a/src/7.2/classes/ActiveSupport/Dependencies/RequireDependency.html b/src/7.2/classes/ActiveSupport/Dependencies/RequireDependency.html index 2dfc362dca..4bbcd41bdf 100644 --- a/src/7.2/classes/ActiveSupport/Dependencies/RequireDependency.html +++ b/src/7.2/classes/ActiveSupport/Dependencies/RequireDependency.html @@ -68,7 +68,7 @@

    Warning: This method is obsolete. The semantics of the autoloader match Ruby’s and you do not need to be defensive with load order anymore. Just refer to classes and modules normally.

    -

    Engines that do not control the mode in which their parent application runs should call require_dependency where needed in case the runtime mode is :classic.

    +

    Engines that do not control the mode in which their parent application runs should call require_dependency where needed in case the runtime mode is :classic.

    diff --git a/src/7.2/classes/ActiveSupport/Deprecation/Behavior.html b/src/7.2/classes/ActiveSupport/Deprecation/Behavior.html index 9f0a09f412..1a5dd71ad5 100644 --- a/src/7.2/classes/ActiveSupport/Deprecation/Behavior.html +++ b/src/7.2/classes/ActiveSupport/Deprecation/Behavior.html @@ -24,22 +24,22 @@

    Behavior module allows to determine how to display deprecation messages. You can create a custom behavior or set any from the DEFAULT_BEHAVIORS constant. Available behaviors are:

    -
    :raise +
    :raise

    Raise ActiveSupport::DeprecationException.

    -
    :stderr +

    :stderr

    Log all deprecation warnings to $stderr.

    -
    :log +
    :log
    -

    Log all deprecation warnings to Rails.logger.

    -
    :notify +

    Log all deprecation warnings to Rails.logger.

    +
    :notify

    Use ActiveSupport::Notifications to notify deprecation.rails.

    -
    :report +
    :report

    Use ActiveSupport::ErrorReporter to report deprecations.

    -
    :silence +
    :silence

    Do nothing. On Rails, set config.active_support.report_deprecations = false to disable all behaviors.

    @@ -157,22 +157,22 @@

    Sets the behavior to the specified value. Can be a single value, array, or an object that responds to call.

    Available behaviors:

    -
    :raise +
    :raise

    Raise ActiveSupport::DeprecationException.

    -
    :stderr +
    :stderr

    Log all deprecation warnings to $stderr.

    -
    :log +
    :log
    -

    Log all deprecation warnings to Rails.logger.

    -
    :notify +

    Log all deprecation warnings to Rails.logger.

    +
    :notify

    Use ActiveSupport::Notifications to notify deprecation.rails.

    -
    :report +
    :report

    Use ActiveSupport::ErrorReporter to report deprecations.

    -
    :silence +
    :silence

    Do nothing.

    diff --git a/src/7.2/classes/ActiveSupport/Deprecation/DeprecatedConstantAccessor.html b/src/7.2/classes/ActiveSupport/Deprecation/DeprecatedConstantAccessor.html index 0f8a9e2a30..312084cdb7 100644 --- a/src/7.2/classes/ActiveSupport/Deprecation/DeprecatedConstantAccessor.html +++ b/src/7.2/classes/ActiveSupport/Deprecation/DeprecatedConstantAccessor.html @@ -245,7 +245,7 @@

    The message can be customized with the optional message keyword argument.

    -

    For this to work, a const_missing hook is installed. When client code references the deprecated constant, the callback prints the message and constantizes the replacement.

    +

    For this to work, a const_missing hook is installed. When client code references the deprecated constant, the callback prints the message and constantizes the replacement.

    Caveat: If the deprecated constant name is reachable in a different namespace and Ruby constant lookup finds it, the hook won’t be called and the deprecation won’t work as intended. This may happen, for example, if an ancestor of the enclosing namespace has a constant with the same name. This is an unsupported edge case.

    diff --git a/src/7.2/classes/ActiveSupport/DescendantsTracker.html b/src/7.2/classes/ActiveSupport/DescendantsTracker.html index 146647e467..12200e0e2c 100644 --- a/src/7.2/classes/ActiveSupport/DescendantsTracker.html +++ b/src/7.2/classes/ActiveSupport/DescendantsTracker.html @@ -27,7 +27,7 @@

    ActiveSupport::DescendantsTracker does not provide any benefit.

    diff --git a/src/7.2/classes/ActiveSupport/Duration.html b/src/7.2/classes/ActiveSupport/Duration.html index f8f8ce0ad0..eaa4c04077 100644 --- a/src/7.2/classes/ActiveSupport/Duration.html +++ b/src/7.2/classes/ActiveSupport/Duration.html @@ -364,7 +364,7 @@

    Creates a new Duration from string formatted according to ISO 8601 Duration.

    -

    See ISO 8601 for more information. This method allows negative parts to be present in pattern. If invalid string is provided, it will raise ActiveSupport::Duration::ISO8601Parser::ParsingError.

    +

    See ISO 8601 for more information. This method allows negative parts to be present in pattern. If invalid string is provided, it will raise ActiveSupport::Duration::ISO8601Parser::ParsingError.

    diff --git a/src/7.2/classes/ActiveSupport/EncryptedConfiguration.html b/src/7.2/classes/ActiveSupport/EncryptedConfiguration.html index 41ef242ead..ad8c6809f2 100644 --- a/src/7.2/classes/ActiveSupport/EncryptedConfiguration.html +++ b/src/7.2/classes/ActiveSupport/EncryptedConfiguration.html @@ -33,7 +33,7 @@

    EncryptedFile to access values stored as encrypted YAML.

    -

    Values can be accessed via Hash methods, such as fetch and dig, or via dynamic accessor methods, similar to OrderedOptions.

    +

    Values can be accessed via Hash methods, such as fetch and dig, or via dynamic accessor methods, similar to OrderedOptions.

    my_config = ActiveSupport::EncryptedConfiguration.new(...)
     my_config.read # => "some_secret: 123\nsome_namespace:\n  another_secret: 456"
    diff --git a/src/7.2/classes/ActiveSupport/EncryptedFile.html b/src/7.2/classes/ActiveSupport/EncryptedFile.html
    index 421037b472..5fca5875f1 100644
    --- a/src/7.2/classes/ActiveSupport/EncryptedFile.html
    +++ b/src/7.2/classes/ActiveSupport/EncryptedFile.html
    @@ -274,7 +274,7 @@ 

    -

    Returns the encryption key, first trying the environment variable specified by env_key, then trying the key file specified by key_path. If raise_if_missing_key is true, raises MissingKeyError if the environment variable is not set and the key file does not exist.

    +

    Returns the encryption key, first trying the environment variable specified by env_key, then trying the key file specified by key_path. If raise_if_missing_key is true, raises MissingKeyError if the environment variable is not set and the key file does not exist.

    @@ -309,7 +309,7 @@

    -

    Returns truthy if key is truthy. Returns falsy otherwise. Unlike key, does not raise MissingKeyError when raise_if_missing_key is true.

    +

    Returns truthy if key is truthy. Returns falsy otherwise. Unlike key, does not raise MissingKeyError when raise_if_missing_key is true.

    @@ -348,7 +348,7 @@

    Raises:

    • -

      MissingKeyError if the key is missing and raise_if_missing_key is true.

      +

      MissingKeyError if the key is missing and raise_if_missing_key is true.

    • MissingContentError if the encrypted file does not exist or otherwise if the key is missing.

    • diff --git a/src/7.2/classes/ActiveSupport/ErrorReporter.html b/src/7.2/classes/ActiveSupport/ErrorReporter.html index e108bc1b29..dda1710cf5 100644 --- a/src/7.2/classes/ActiveSupport/ErrorReporter.html +++ b/src/7.2/classes/ActiveSupport/ErrorReporter.html @@ -33,7 +33,7 @@

      Active Support Error Reporter

      -

      ActiveSupport::ErrorReporter is a common interface for error reporting services.

      +

      ActiveSupport::ErrorReporter is a common interface for error reporting services.

      To rescue and report any unhandled error, you can use the handle method:

      diff --git a/src/7.2/classes/ActiveSupport/ExecutionWrapper.html b/src/7.2/classes/ActiveSupport/ExecutionWrapper.html index 927cb68849..b97de73d55 100644 --- a/src/7.2/classes/ActiveSupport/ExecutionWrapper.html +++ b/src/7.2/classes/ActiveSupport/ExecutionWrapper.html @@ -107,7 +107,7 @@

      Register an object to be invoked during both the run and complete steps.

      -

      hook.complete will be passed the value returned from hook.run, and will only be invoked if run has previously been called. (Mostly, this means it won’t be invoked if an exception occurs in a preceding to_run block; all ordinary to_complete blocks are invoked in that situation.)

      +

      hook.complete will be passed the value returned from hook.run, and will only be invoked if run has previously been called. (Mostly, this means it won’t be invoked if an exception occurs in a preceding to_run block; all ordinary to_complete blocks are invoked in that situation.)

      diff --git a/src/7.2/classes/ActiveSupport/FileUpdateChecker.html b/src/7.2/classes/ActiveSupport/FileUpdateChecker.html index b44924bd68..47282817e4 100644 --- a/src/7.2/classes/ActiveSupport/FileUpdateChecker.html +++ b/src/7.2/classes/ActiveSupport/FileUpdateChecker.html @@ -39,10 +39,10 @@

      File U

    • execute which executes the given block on initialization and updates the latest watched files and timestamp.

    • -

      execute_if_updated which just executes the block if it was updated.

      +

      execute_if_updated which just executes the block if it was updated.

    -

    After initialization, a call to execute_if_updated must execute the block only if there was really a change in the filesystem.

    +

    After initialization, a call to execute_if_updated must execute the block only if there was really a change in the filesystem.

    This class is used by Rails to reload the I18n framework whenever they are changed upon a new request.

    @@ -247,7 +247,7 @@

    -

    Check if any of the entries were updated. If so, the watched and/or updated_at values are cached until the block is executed via execute or execute_if_updated.

    +

    Check if any of the entries were updated. If so, the watched and/or updated_at values are cached until the block is executed via execute or execute_if_updated.

    diff --git a/src/7.2/classes/ActiveSupport/HashWithIndifferentAccess.html b/src/7.2/classes/ActiveSupport/HashWithIndifferentAccess.html index 0ecb28ea2a..7dd6e67067 100644 --- a/src/7.2/classes/ActiveSupport/HashWithIndifferentAccess.html +++ b/src/7.2/classes/ActiveSupport/HashWithIndifferentAccess.html @@ -63,7 +63,7 @@

    Hash#with_indifferent_access:

    rgb = { black: '#000000', white: '#FFFFFF' }.with_indifferent_access
     
    @@ -885,7 +885,7 @@

    -

    Returns true so that Array#extract_options! finds members of this class.

    +

    Returns true so that Array#extract_options! finds members of this class.

    @@ -1392,7 +1392,7 @@

    -

    Same semantics as reverse_merge but modifies the receiver in-place.

    +

    Same semantics as reverse_merge but modifies the receiver in-place.

    @@ -1934,7 +1934,7 @@

    hash.update({ "a" => 1 }, { "b" => 2 }) # => { "a" => 1, "b" => 2 }

    -

    The arguments can be either an ActiveSupport::HashWithIndifferentAccess or a regular Hash. In either case the merge respects the semantics of indifferent access.

    +

    The arguments can be either an ActiveSupport::HashWithIndifferentAccess or a regular Hash. In either case the merge respects the semantics of indifferent access.

    If the argument is a regular hash with keys :key and "key" only one of the values end up in the receiver, but which one is unspecified.

    diff --git a/src/7.2/classes/ActiveSupport/InheritableOptions.html b/src/7.2/classes/ActiveSupport/InheritableOptions.html index 19144fd178..9f6b35656c 100644 --- a/src/7.2/classes/ActiveSupport/InheritableOptions.html +++ b/src/7.2/classes/ActiveSupport/InheritableOptions.html @@ -31,7 +31,7 @@

    Inheritable Options

    -

    InheritableOptions provides a constructor to build an OrderedOptions hash inherited from another hash.

    +

    InheritableOptions provides a constructor to build an OrderedOptions hash inherited from another hash.

    Use this if you already have some hash and you want to create a new one based on it.

    diff --git a/src/7.2/classes/ActiveSupport/LazyLoadHooks.html b/src/7.2/classes/ActiveSupport/LazyLoadHooks.html index d9baef8266..3211710bcd 100644 --- a/src/7.2/classes/ActiveSupport/LazyLoadHooks.html +++ b/src/7.2/classes/ActiveSupport/LazyLoadHooks.html @@ -25,7 +25,7 @@

    Lazy Load Hooks

    -

    LazyLoadHooks allows Rails to lazily load a lot of components and thus making the app boot faster. Because of this feature now there is no need to require ActiveRecord::Base at boot time purely to apply configuration. Instead a hook is registered that applies configuration once ActiveRecord::Base is loaded. Here ActiveRecord::Base is used as example but this feature can be applied elsewhere too.

    +

    LazyLoadHooks allows Rails to lazily load a lot of components and thus making the app boot faster. Because of this feature now there is no need to require ActiveRecord::Base at boot time purely to apply configuration. Instead a hook is registered that applies configuration once ActiveRecord::Base is loaded. Here ActiveRecord::Base is used as example but this feature can be applied elsewhere too.

    Here is an example where on_load method is called to register a hook.

    @@ -37,7 +37,7 @@

    Lazy Load Hoo end -

    When the entirety of ActiveRecord::Base has been evaluated then run_load_hooks is invoked. The very last line of ActiveRecord::Base is:

    +

    When the entirety of ActiveRecord::Base has been evaluated then run_load_hooks is invoked. The very last line of ActiveRecord::Base is:

    ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base)
     
    @@ -157,7 +157,7 @@

    ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base)
     
    -

    In the case of the above example, it will execute all hooks registered for :active_record within the class ActiveRecord::Base.

    +

    In the case of the above example, it will execute all hooks registered for :active_record within the class ActiveRecord::Base.

    diff --git a/src/7.2/classes/ActiveSupport/LogSubscriber.html b/src/7.2/classes/ActiveSupport/LogSubscriber.html index 479873f5e1..29c8bbfa67 100644 --- a/src/7.2/classes/ActiveSupport/LogSubscriber.html +++ b/src/7.2/classes/ActiveSupport/LogSubscriber.html @@ -33,7 +33,7 @@

    Active Support Log Subscriber

    -

    ActiveSupport::LogSubscriber is an object set to consume ActiveSupport::Notifications with the sole purpose of logging them. The log subscriber dispatches notifications to a registered object based on its given namespace.

    +

    ActiveSupport::LogSubscriber is an object set to consume ActiveSupport::Notifications with the sole purpose of logging them. The log subscriber dispatches notifications to a registered object based on its given namespace.

    An example would be Active Record log subscriber responsible for logging queries:

    @@ -52,7 +52,7 @@

    After configured, whenever a "sql.active_record" notification is published, it will properly dispatch the event (ActiveSupport::Notifications::Event) to the sql method.

    -

    Being an ActiveSupport::Notifications consumer, ActiveSupport::LogSubscriber exposes a simple interface to check if instrumented code raises an exception. It is common to log a different message in case of an error, and this can be achieved by extending the previous example:

    +

    Being an ActiveSupport::Notifications consumer, ActiveSupport::LogSubscriber exposes a simple interface to check if instrumented code raises an exception. It is common to log a different message in case of an error, and this can be achieved by extending the previous example:

    module ActiveRecord
       class LogSubscriber < ActiveSupport::LogSubscriber
    @@ -72,7 +72,7 @@ 

    end

    -

    ActiveSupport::LogSubscriber also has some helpers to deal with logging. For example, ActiveSupport::LogSubscriber.flush_all! will ensure that all logs are flushed, and it is called in Rails::Rack::Logger after a request finishes.

    +

    ActiveSupport::LogSubscriber also has some helpers to deal with logging. For example, ActiveSupport::LogSubscriber.flush_all! will ensure that all logs are flushed, and it is called in Rails::Rack::Logger after a request finishes.

    diff --git a/src/7.2/classes/ActiveSupport/MessageEncryptor.html b/src/7.2/classes/ActiveSupport/MessageEncryptor.html index 14adecd200..c97e0887f7 100644 --- a/src/7.2/classes/ActiveSupport/MessageEncryptor.html +++ b/src/7.2/classes/ActiveSupport/MessageEncryptor.html @@ -45,7 +45,7 @@

    decrypt_and_verify method will raise an ActiveSupport::MessageEncryptor::InvalidMessage exception if the data provided cannot be decrypted or verified.

    crypt.decrypt_and_verify('not encrypted data') # => ActiveSupport::MessageEncryptor::InvalidMessage
     
    @@ -83,7 +83,7 @@

    Maki

    Rotating keys

    -

    MessageEncryptor also supports rotating out old configurations by falling back to a stack of encryptors. Call rotate to build and add an encryptor so decrypt_and_verify will also try the fallback.

    +

    MessageEncryptor also supports rotating out old configurations by falling back to a stack of encryptors. Call rotate to build and add an encryptor so decrypt_and_verify will also try the fallback.

    By default any rotated encryptors use the values of the primary encryptor unless specified otherwise.

    @@ -230,13 +230,13 @@

    Options

    -
    :cipher +
    :cipher

    Cipher to use. Can be any cipher returned by OpenSSL::Cipher.ciphers. Default is ‘aes-256-gcm’.

    -
    :digest +
    :digest

    Digest used for signing. Ignored when using an AEAD cipher like ‘aes-256-gcm’.

    -
    :serializer +
    :serializer

    The serializer used to serialize message data. You can specify any object that responds to dump and load, or you can choose from several preconfigured serializers: :marshal, :json_allow_marshal, :json, :message_pack_allow_marshal, :message_pack.

    @@ -247,10 +247,10 @@

    Options

    The :message_pack and :message_pack_allow_marshal serializers use ActiveSupport::MessagePack, which can roundtrip some Ruby types that are not supported by JSON, and may provide improved performance. However, these require the msgpack gem.

    When using Rails, the default depends on config.active_support.message_serializer. Otherwise, the default is :marshal.

    -
    :url_safe +
    :url_safe

    By default, MessageEncryptor generates RFC 4648 compliant strings which are not URL-safe. In other words, they can contain “+” and “/”. If you want to generate URL-safe strings (in compliance with “Base 64 Encoding with URL and Filename Safe Alphabet” in RFC 4648), you can pass true.

    -
    :force_legacy_metadata_serializer +
    :force_legacy_metadata_serializer

    Whether to use the legacy metadata serializer, which serializes the message first, then wraps it in an envelope which is also serialized. This was the default in Rails 7.0 and below.

    @@ -303,9 +303,9 @@

    Decrypt and verify a message. We need to verify the message in order to avoid padding attacks. Reference: www.limited-entropy.com/padding-oracle-attacks/.

    Options

    -
    :purpose +
    :purpose
    -

    The purpose that the message was generated with. If the purpose does not match, decrypt_and_verify will return nil.

    +

    The purpose that the message was generated with. If the purpose does not match, decrypt_and_verify will return nil.

    message = encryptor.encrypt_and_sign("hello", purpose: "greeting")
     encryptor.decrypt_and_verify(message, purpose: "greeting") # => "hello"
    @@ -359,7 +359,7 @@ 

    Encrypt and sign a message. We need to sign the message in order to avoid padding attacks. Reference: www.limited-entropy.com/padding-oracle-attacks/.

    Options

    -
    :expires_at +
    :expires_at

    The datetime at which the message expires. After this datetime, verification of the message will fail.

    @@ -368,7 +368,7 @@

    Options

    # 24 hours later... encryptor.decrypt_and_verify(message) # => nil
    -
    :expires_in +
    :expires_in

    The duration for which the message is valid. After this duration has elapsed, verification of the message will fail.

    @@ -377,7 +377,7 @@

    Options

    # 24 hours later... encryptor.decrypt_and_verify(message) # => nil -
    :purpose +
    :purpose

    The purpose of the message. If specified, the same purpose must be specified when verifying the message; otherwise, verification will fail. (See decrypt_and_verify.)

    diff --git a/src/7.2/classes/ActiveSupport/MessagePack.html b/src/7.2/classes/ActiveSupport/MessagePack.html index 719a794d11..a199d6114f 100644 --- a/src/7.2/classes/ActiveSupport/MessagePack.html +++ b/src/7.2/classes/ActiveSupport/MessagePack.html @@ -148,7 +148,7 @@

    -

    Returns true if the given dump begins with an ActiveSupport::MessagePack signature.

    +

    Returns true if the given dump begins with an ActiveSupport::MessagePack signature.

    diff --git a/src/7.2/classes/ActiveSupport/MessageVerifier.html b/src/7.2/classes/ActiveSupport/MessageVerifier.html index 119575aca4..05d62fabf1 100644 --- a/src/7.2/classes/ActiveSupport/MessageVerifier.html +++ b/src/7.2/classes/ActiveSupport/MessageVerifier.html @@ -31,9 +31,9 @@

    Active Support Message Verifier

    -

    MessageVerifier makes it easy to generate and verify messages which are signed to prevent tampering.

    +

    MessageVerifier makes it easy to generate and verify messages which are signed to prevent tampering.

    -

    In a Rails application, you can use Rails.application.message_verifier to manage unique instances of verifiers for each use case. Learn more.

    +

    In a Rails application, you can use Rails.application.message_verifier to manage unique instances of verifiers for each use case. Learn more.

    This is useful for cases like remember-me tokens and auto-unsubscribe links where the session store isn’t suitable or available.

    @@ -98,7 +98,7 @@

    Expiring m @verifier.generate("signed message", expires_at: Time.now.end_of_year) -

    Messages can then be verified and returned until expiry. Thereafter, the verified method returns nil while verify raises ActiveSupport::MessageVerifier::InvalidSignature.

    +

    Messages can then be verified and returned until expiry. Thereafter, the verified method returns nil while verify raises ActiveSupport::MessageVerifier::InvalidSignature.

    Rotating keys

    @@ -201,10 +201,10 @@

    Initialize a new MessageVerifier with a secret for the signature.

    Options

    -
    :digest +
    :digest

    Digest used for signing. The default is "SHA1". See OpenSSL::Digest for alternatives.

    -
    :serializer +
    :serializer

    The serializer used to serialize message data. You can specify any object that responds to dump and load, or you can choose from several preconfigured serializers: :marshal, :json_allow_marshal, :json, :message_pack_allow_marshal, :message_pack.

    @@ -215,10 +215,10 @@

    Options

    The :message_pack and :message_pack_allow_marshal serializers use ActiveSupport::MessagePack, which can roundtrip some Ruby types that are not supported by JSON, and may provide improved performance. However, these require the msgpack gem.

    When using Rails, the default depends on config.active_support.message_serializer. Otherwise, the default is :marshal.

    -
    :url_safe +
    :url_safe

    By default, MessageVerifier generates RFC 4648 compliant strings which are not URL-safe. In other words, they can contain “+” and “/”. If you want to generate URL-safe strings (in compliance with “Base 64 Encoding with URL and Filename Safe Alphabet” in RFC 4648), you can pass true.

    -
    :force_legacy_metadata_serializer +
    :force_legacy_metadata_serializer

    Whether to use the legacy metadata serializer, which serializes the message first, then wraps it in an envelope which is also serialized. This was the default in Rails 7.0 and below.

    @@ -267,14 +267,14 @@

    Generates a signed message for the provided value.

    -

    The message is signed with the MessageVerifier‘s secret. Returns Base64-encoded message joined with the generated signature.

    +

    The message is signed with the MessageVerifier‘s secret. Returns Base64-encoded message joined with the generated signature.

    verifier = ActiveSupport::MessageVerifier.new("secret")
     verifier.generate("signed message") # => "BAhJIhNzaWduZWQgbWVzc2FnZQY6BkVU--f67d5f27c3ee0b8483cebf2103757455e947493b"
     

    Options

    -
    :expires_at +
    :expires_at

    The datetime at which the message expires. After this datetime, verification of the message will fail.

    @@ -284,7 +284,7 @@

    Options

    verifier.verified(message) # => nil verifier.verify(message) # => raises ActiveSupport::MessageVerifier::InvalidSignature -
    :expires_in +

    :expires_in

    The duration for which the message is valid. After this duration has elapsed, verification of the message will fail.

    @@ -294,7 +294,7 @@

    Options

    verifier.verified(message) # => nil verifier.verify(message) # => raises ActiveSupport::MessageVerifier::InvalidSignature -
    :purpose +
    :purpose

    The purpose of the message. If specified, the same purpose must be specified when verifying the message; otherwise, verification will fail. (See verified and verify.)

    @@ -332,7 +332,7 @@

    -

    Checks if a signed message could have been generated by signing an object with the MessageVerifier‘s secret.

    +

    Checks if a signed message could have been generated by signing an object with the MessageVerifier‘s secret.

    verifier = ActiveSupport::MessageVerifier.new("secret")
     signed_message = verifier.generate("signed message")
    @@ -375,7 +375,7 @@ 

    -

    Decodes the signed message using the MessageVerifier‘s secret.

    +

    Decodes the signed message using the MessageVerifier‘s secret.

    verifier = ActiveSupport::MessageVerifier.new("secret")
     
    @@ -402,7 +402,7 @@ 

    Options

    -
    :purpose +
    :purpose

    The purpose that the message was generated with. If the purpose does not match, verified will return nil.

    @@ -456,7 +456,7 @@

    -

    Decodes the signed message using the MessageVerifier‘s secret.

    +

    Decodes the signed message using the MessageVerifier‘s secret.

    verifier = ActiveSupport::MessageVerifier.new("secret")
     signed_message = verifier.generate("signed message")
    @@ -464,14 +464,14 @@ 

    verifier.verify(signed_message) # => "signed message"

    -

    Raises InvalidSignature if the message was not signed with the same secret or was not Base64-encoded.

    +

    Raises InvalidSignature if the message was not signed with the same secret or was not Base64-encoded.

    other_verifier = ActiveSupport::MessageVerifier.new("different_secret")
     other_verifier.verify(signed_message) # => ActiveSupport::MessageVerifier::InvalidSignature
     

    Options

    -
    :purpose +
    :purpose

    The purpose that the message was generated with. If the purpose does not match, verify will raise ActiveSupport::MessageVerifier::InvalidSignature.

    diff --git a/src/7.2/classes/ActiveSupport/Multibyte/Chars.html b/src/7.2/classes/ActiveSupport/Multibyte/Chars.html index bcff452bbe..2debab9ffb 100644 --- a/src/7.2/classes/ActiveSupport/Multibyte/Chars.html +++ b/src/7.2/classes/ActiveSupport/Multibyte/Chars.html @@ -39,7 +39,7 @@

    Chars objects are perfectly interchangeable with String objects as long as no explicit class checks are made. If certain methods do explicitly check the class, call to_s before you pass chars objects to them.

    +

    Chars objects are perfectly interchangeable with String objects as long as no explicit class checks are made. If certain methods do explicitly check the class, call to_s before you pass chars objects to them.

    bad.explicit_checking_method 'T'.mb_chars.downcase.to_s
     
    diff --git a/src/7.2/classes/ActiveSupport/Notifications.html b/src/7.2/classes/ActiveSupport/Notifications.html index b21bff470f..8065e67375 100644 --- a/src/7.2/classes/ActiveSupport/Notifications.html +++ b/src/7.2/classes/ActiveSupport/Notifications.html @@ -29,7 +29,7 @@

    Notifications

    -

    ActiveSupport::Notifications provides an instrumentation API for Ruby.

    +

    ActiveSupport::Notifications provides an instrumentation API for Ruby.

    Instrumenters

    @@ -56,7 +56,7 @@

    Subscribers

    end

    -

    Event objects record CPU time and allocations. If you don’t need this it’s also possible to pass a block that accepts five arguments:

    +

    Event objects record CPU time and allocations. If you don’t need this it’s also possible to pass a block that accepts five arguments:

    ActiveSupport::Notifications.subscribe('render') do |name, start, finish, id, payload|
       name    # => String, name of the event (such as 'render' from above)
    @@ -379,7 +379,7 @@ 

    -

    Performs the same functionality as subscribe, but the start and finish block arguments are in monotonic time instead of wall-clock time. Monotonic time will not jump forward or backward (due to NTP or Daylights Savings). Use monotonic_subscribe when accuracy of time duration is important. For example, computing elapsed time between two events.

    +

    Performs the same functionality as subscribe, but the start and finish block arguments are in monotonic time instead of wall-clock time. Monotonic time will not jump forward or backward (due to NTP or Daylights Savings). Use monotonic_subscribe when accuracy of time duration is important. For example, computing elapsed time between two events.

    @@ -453,7 +453,7 @@

    You can subscribe to events by passing a String to match exact event names, or by passing a Regexp to match all events that match a pattern.

    -

    If the block passed to the method only takes one argument, it will yield an Event object to the block:

    +

    If the block passed to the method only takes one argument, it will yield an Event object to the block:

    ActiveSupport::Notifications.subscribe(/render/) do |event|
       @event = event
    diff --git a/src/7.2/classes/ActiveSupport/Notifications/Fanout/Handle.html b/src/7.2/classes/ActiveSupport/Notifications/Fanout/Handle.html
    index 19980bdfaf..852540a5e7 100644
    --- a/src/7.2/classes/ActiveSupport/Notifications/Fanout/Handle.html
    +++ b/src/7.2/classes/ActiveSupport/Notifications/Fanout/Handle.html
    @@ -29,11 +29,11 @@ 

    -

    A Handle is used to record the start and finish time of event.

    +

    A Handle is used to record the start and finish time of event.

    Both start and finish must each be called exactly once.

    -

    Where possible, it’s best to use the block form: ActiveSupport::Notifications.instrument. Handle is a low-level API intended for cases where the block form can’t be used.

    +

    Where possible, it’s best to use the block form: ActiveSupport::Notifications.instrument. Handle is a low-level API intended for cases where the block form can’t be used.

    handle = ActiveSupport::Notifications.instrumenter.build_handle("my.event", {})
     begin
    diff --git a/src/7.2/classes/ActiveSupport/Notifications/Instrumenter.html b/src/7.2/classes/ActiveSupport/Notifications/Instrumenter.html
    index 95515215e2..79fcb831be 100644
    --- a/src/7.2/classes/ActiveSupport/Notifications/Instrumenter.html
    +++ b/src/7.2/classes/ActiveSupport/Notifications/Instrumenter.html
    @@ -159,7 +159,7 @@ 

    start and finish must each be called exactly once on the returned object.

    -

    Where possible, it’s best to use instrument, which will record the start and finish of the event and correctly handle any exceptions. build_handle is a low-level API intended for cases where using instrument isn’t possible.

    +

    Where possible, it’s best to use instrument, which will record the start and finish of the event and correctly handle any exceptions. build_handle is a low-level API intended for cases where using instrument isn’t possible.

    See ActiveSupport::Notifications::Fanout::Handle.

    diff --git a/src/7.2/classes/ActiveSupport/NumberHelper.html b/src/7.2/classes/ActiveSupport/NumberHelper.html index f8640b2aa5..38973d4e60 100644 --- a/src/7.2/classes/ActiveSupport/NumberHelper.html +++ b/src/7.2/classes/ActiveSupport/NumberHelper.html @@ -121,51 +121,51 @@

    The currency unit and number formatting of the current locale will be used unless otherwise specified via options. No currency conversion is performed. If the user is given a way to change their locale, they will also be able to change the relative value of the currency displayed with this helper. If your application will ever support multiple locales, you may want to specify a constant :locale option or consider using a library capable of currency conversion.

    Options

    -
    :locale +
    :locale

    The locale to use for formatting. Defaults to the current locale.

    number_to_currency(1234567890.506, locale: :fr)
     # => "1 234 567 890,51 €"
     
    -
    :precision +
    :precision

    The level of precision. Defaults to 2.

    number_to_currency(1234567890.123, precision: 3) # => "$1,234,567,890.123"
     number_to_currency(0.456789, precision: 0)       # => "$0"
     
    -
    :round_mode +
    :round_mode

    Specifies how rounding is performed. See BigDecimal.mode. Defaults to :default.

    number_to_currency(1234567890.01, precision: 0, round_mode: :up)
     # => "$1,234,567,891"
     
    -
    :unit +
    :unit

    The denomination of the currency. Defaults to "$".

    -
    :separator +
    :separator

    The decimal separator. Defaults to ".".

    -
    :delimiter +
    :delimiter

    The thousands delimiter. Defaults to ",".

    -
    :format +
    :format

    The format for non-negative numbers. %u represents the currency, and %n represents the number. Defaults to "%u%n".

    number_to_currency(1234567890.50, format: "%n %u")
     # => "1,234,567,890.50 $"
     
    -
    :negative_format +
    :negative_format

    The format for negative numbers. %u and %n behave the same as in :format, but %n represents the absolute value of the number. Defaults to the value of :format prepended with -.

    number_to_currency(-1234567890.50, negative_format: "(%u%n)")
     # => "($1,234,567,890.50)"
     
    -
    :strip_insignificant_zeros +
    :strip_insignificant_zeros

    Whether to remove insignificant zeros after the decimal separator. Defaults to false.

    @@ -219,28 +219,28 @@

    Options

    -
    :locale +
    :locale

    The locale to use for formatting. Defaults to the current locale.

    number_to_delimited(12345678.05, locale: :fr)
     # => "12 345 678,05"
     
    -
    :delimiter +
    :delimiter

    The thousands delimiter. Defaults to ",".

    number_to_delimited(12345678, delimiter: ".")
     # => "12.345.678"
     
    -
    :separator +
    :separator

    The decimal separator. Defaults to ".".

    number_to_delimited(12345678.05, separator: " ")
     # => "12,345,678 05"
     
    -
    :delimiter_pattern +
    :delimiter_pattern

    A regexp to determine the placement of delimiters. Helpful when using currency formats like INR.

    @@ -297,37 +297,37 @@

    See number_to_human_size if you want to pretty-print a file size.

    Options

    -
    :locale +
    :locale

    The locale to use for formatting. Defaults to the current locale.

    -
    :precision +
    :precision

    The level of precision. Defaults to 3.

    number_to_human(123456, precision: 2) # => "120 Thousand"
     number_to_human(123456, precision: 4) # => "123.5 Thousand"
     
    -
    :round_mode +
    :round_mode

    Specifies how rounding is performed. See BigDecimal.mode. Defaults to :default.

    number_to_human(123456, precision: 2, round_mode: :up)
     # => "130 Thousand"
     
    -
    :significant +
    :significant

    Whether :precision should be applied to significant digits instead of fractional digits. Defaults to true.

    -
    :separator +
    :separator

    The decimal separator. Defaults to ".".

    number_to_human(123456, precision: 4, separator: ",")
     # => "123,5 Thousand"
     
    -
    :delimiter +
    :delimiter

    The thousands delimiter. Defaults to ",".

    -
    :strip_insignificant_zeros +
    :strip_insignificant_zeros

    Whether to remove insignificant zeros after the decimal separator. Defaults to true.

    @@ -336,10 +336,10 @@

    Options

    number_to_human(10.01) # => "10" number_to_human(10.01, strip_insignificant_zeros: false) # => "10.0"

    -
    :format +
    :format

    The format of the output. %n represents the number, and %u represents the quantifier (e.g., “Thousand”). Defaults to "%n %u".

    -
    :units +
    :units

    A Hash of custom unit quantifier names.

    @@ -427,37 +427,37 @@

    See number_to_human if you want to pretty-print a generic number.

    Options

    -
    :locale +
    :locale

    The locale to use for formatting. Defaults to the current locale.

    -
    :precision +
    :precision

    The level of precision. Defaults to 3.

    number_to_human_size(123456, precision: 2)  # => "120 KB"
     number_to_human_size(1234567, precision: 2) # => "1.2 MB"
     
    -
    :round_mode +
    :round_mode

    Specifies how rounding is performed. See BigDecimal.mode. Defaults to :default.

    number_to_human_size(123456, precision: 2, round_mode: :up)
     # => "130 KB"
     
    -
    :significant +
    :significant

    Whether :precision should be applied to significant digits instead of fractional digits. Defaults to true.

    -
    :separator +
    :separator

    The decimal separator. Defaults to ".".

    number_to_human_size(1234567, separator: ",")
     # => "1,18 MB"
     
    -
    :delimiter +
    :delimiter

    The thousands delimiter. Defaults to ",".

    -
    :strip_insignificant_zeros +
    :strip_insignificant_zeros

    Whether to remove insignificant zeros after the decimal separator. Defaults to true.

    @@ -506,14 +506,14 @@

    Options

    -
    :locale +
    :locale

    The locale to use for formatting. Defaults to the current locale.

    number_to_percentage(1000, locale: :fr)
     # => "1000,000%"
     
    -
    :precision +
    :precision

    The level of precision, or nil to preserve number‘s precision. Defaults to 2.

    @@ -521,14 +521,14 @@

    Options

    number_to_percentage(99.999, precision: 0) # => "100%" number_to_percentage(99.999, precision: nil) # => "99.999%" -
    :round_mode +
    :round_mode

    Specifies how rounding is performed. See BigDecimal.mode. Defaults to :default.

    number_to_percentage(12.3456789, precision: 4, round_mode: :down)
     # => "12.3456%"
     
    -
    :significant +
    :significant

    Whether :precision should be applied to significant digits instead of fractional digits. Defaults to false.

    @@ -537,16 +537,16 @@

    Options

    number_to_percentage(12345.6789, precision: 2) # => "12345.68%" number_to_percentage(12345.6789, precision: 2, significant: true) # => "12000%" -
    :separator +
    :separator

    The decimal separator. Defaults to ".".

    -
    :delimiter +
    :delimiter

    The thousands delimiter. Defaults to ",".

    -
    :strip_insignificant_zeros +
    :strip_insignificant_zeros

    Whether to remove insignificant zeros after the decimal separator. Defaults to false.

    -
    :format +
    :format

    The format of the output. %n represents the number. Defaults to "%n%".

    @@ -600,35 +600,35 @@

    Options

    -
    :area_code +
    :area_code

    Whether to use parentheses for the area code. Defaults to false.

    number_to_phone(1235551234, area_code: true)
     # => "(123) 555-1234"
     
    -
    :delimiter +
    :delimiter

    The digit group delimiter to use. Defaults to "-".

    number_to_phone(1235551234, delimiter: " ")
     # => "123 555 1234"
     
    -
    :country_code +
    :country_code

    A country code to prepend.

    number_to_phone(1235551234, country_code: 1)
     # => "+1-123-555-1234"
     
    -
    :extension +
    :extension

    An extension to append.

    number_to_phone(1235551234, extension: 555)
     # => "123-555-1234 x 555"
     
    -
    :pattern +
    :pattern

    A regexp that specifies how the digits should be grouped. The first three captures from the regexp are treated as digit groups.

    @@ -681,28 +681,28 @@

    Options

    -
    :locale +
    :locale

    The locale to use for formatting. Defaults to the current locale.

    number_to_rounded(111.234, locale: :fr)
     # => "111,234"
     
    -
    :precision +
    :precision

    The level of precision, or nil to preserve number‘s precision. Defaults to 3.

    number_to_rounded(12345.6789, precision: nil)
     # => "12345.6789"
     
    -
    :round_mode +
    :round_mode

    Specifies how rounding is performed. See BigDecimal.mode. Defaults to :default.

    number_to_rounded(12.34, precision: 0, round_mode: :up)
     # => "13"
     
    -
    :significant +
    :significant

    Whether :precision should be applied to significant digits instead of fractional digits. Defaults to false.

    @@ -711,13 +711,13 @@

    Options

    number_to_rounded(12345.6789, precision: 2) # => "12345.68" number_to_rounded(12345.6789, precision: 2, significant: true) # => "12000" -
    :separator +
    :separator

    The decimal separator. Defaults to ".".

    -
    :delimiter +
    :delimiter

    The thousands delimiter. Defaults to ",".

    -
    :strip_insignificant_zeros +
    :strip_insignificant_zeros

    Whether to remove insignificant zeros after the decimal separator. Defaults to false.

    diff --git a/src/7.2/classes/ActiveSupport/NumericWithFormat.html b/src/7.2/classes/ActiveSupport/NumericWithFormat.html index 929afe48a5..19bc8fe80e 100644 --- a/src/7.2/classes/ActiveSupport/NumericWithFormat.html +++ b/src/7.2/classes/ActiveSupport/NumericWithFormat.html @@ -99,7 +99,7 @@

    Provides options for converting numbers into formatted strings. Options are provided for phone numbers, currency, percentage, precision, positional notation, file size, and pretty printing.

    -

    This method is aliased to to_formatted_s.

    +

    This method is aliased to to_formatted_s.

    Options

    diff --git a/src/7.2/classes/ActiveSupport/OrderedOptions.html b/src/7.2/classes/ActiveSupport/OrderedOptions.html index 584dd87459..3e85a6615c 100644 --- a/src/7.2/classes/ActiveSupport/OrderedOptions.html +++ b/src/7.2/classes/ActiveSupport/OrderedOptions.html @@ -31,9 +31,9 @@

    Ordered Options

    -

    OrderedOptions inherits from Hash and provides dynamic accessor methods.

    +

    OrderedOptions inherits from Hash and provides dynamic accessor methods.

    -

    With a Hash, key-value pairs are typically managed like this:

    +

    With a Hash, key-value pairs are typically managed like this:

    h = {}
     h[:boy] = 'John'
    @@ -43,7 +43,7 @@ 

    Ordered Optio h[:dog] # => nil

    -

    Using OrderedOptions, the above code can be written as:

    +

    Using OrderedOptions, the above code can be written as:

    h = ActiveSupport::OrderedOptions.new
     h.boy = 'John'
    diff --git a/src/7.2/classes/ActiveSupport/ParameterFilter.html b/src/7.2/classes/ActiveSupport/ParameterFilter.html
    index 094d893100..483355f736 100644
    --- a/src/7.2/classes/ActiveSupport/ParameterFilter.html
    +++ b/src/7.2/classes/ActiveSupport/ParameterFilter.html
    @@ -31,11 +31,11 @@ 

    Active Support Parameter Filter

    -

    ParameterFilter replaces values in a Hash-like object if their keys match one of the specified filters.

    +

    ParameterFilter replaces values in a Hash-like object if their keys match one of the specified filters.

    Matching based on nested keys is possible by using dot notation, e.g. "credit_card.number".

    -

    If a proc is given as a filter, each key and value of the Hash-like and of any nested Hashes will be passed to it. The value or key can then be mutated as desired using methods such as String#replace.

    +

    If a proc is given as a filter, each key and value of the Hash-like and of any nested Hashes will be passed to it. The value or key can then be mutated as desired using methods such as String#replace.

    # Replaces values with "[FILTERED]" for keys that match /password/i.
     ActiveSupport::ParameterFilter.new([:password])
    @@ -116,7 +116,7 @@ 

    -

    Create instance with given filters. Supported type of filters are String, Regexp, and Proc. Other types of filters are treated as String using to_s. For Proc filters, key, value, and optional original hash is passed to block arguments.

    +

    Create instance with given filters. Supported type of filters are String, Regexp, and Proc. Other types of filters are treated as String using to_s. For Proc filters, key, value, and optional original hash is passed to block arguments.

    Options

    • diff --git a/src/7.2/classes/ActiveSupport/RangeWithFormat.html b/src/7.2/classes/ActiveSupport/RangeWithFormat.html index 256129f1a9..2bbed95d24 100644 --- a/src/7.2/classes/ActiveSupport/RangeWithFormat.html +++ b/src/7.2/classes/ActiveSupport/RangeWithFormat.html @@ -138,7 +138,7 @@

      Convert range to a formatted string. See RANGE_FORMATS for predefined formats.

      -

      This method is aliased to to_formatted_s.

      +

      This method is aliased to to_formatted_s.

      range = (1..100)           # => 1..100
       
      diff --git a/src/7.2/classes/ActiveSupport/Rescuable/ClassMethods.html b/src/7.2/classes/ActiveSupport/Rescuable/ClassMethods.html
      index cffff4bf30..02bfaebc50 100644
      --- a/src/7.2/classes/ActiveSupport/Rescuable/ClassMethods.html
      +++ b/src/7.2/classes/ActiveSupport/Rescuable/ClassMethods.html
      @@ -70,9 +70,9 @@ 

      -

      Registers exception classes with a handler to be called by rescue_with_handler.

      +

      Registers exception classes with a handler to be called by rescue_with_handler.

      -

      rescue_from receives a series of exception classes or class names, and an exception handler specified by a trailing :with option containing the name of a method or a Proc object. Alternatively, a block can be given as the handler.

      +

      rescue_from receives a series of exception classes or class names, and an exception handler specified by a trailing :with option containing the name of a method or a Proc object. Alternatively, a block can be given as the handler.

      Handlers that take one argument will be called with the exception, so that the exception can be inspected when dealing with it.

      diff --git a/src/7.2/classes/ActiveSupport/StringInquirer.html b/src/7.2/classes/ActiveSupport/StringInquirer.html index fb97b6e7a1..3881b3cde5 100644 --- a/src/7.2/classes/ActiveSupport/StringInquirer.html +++ b/src/7.2/classes/ActiveSupport/StringInquirer.html @@ -31,7 +31,7 @@

      String Inquirer

      -

      Wrapping a string in this class gives you a prettier way to test for equality. The value returned by Rails.env is wrapped in a StringInquirer object, so instead of calling this:

      +

      Wrapping a string in this class gives you a prettier way to test for equality. The value returned by Rails.env is wrapped in a StringInquirer object, so instead of calling this:

      Rails.env == 'production'
       
      diff --git a/src/7.2/classes/ActiveSupport/Subscriber.html b/src/7.2/classes/ActiveSupport/Subscriber.html index 0730ed2eca..014ce36638 100644 --- a/src/7.2/classes/ActiveSupport/Subscriber.html +++ b/src/7.2/classes/ActiveSupport/Subscriber.html @@ -31,7 +31,7 @@

      Active Support Subscriber

      -

      ActiveSupport::Subscriber is an object set to consume ActiveSupport::Notifications. The subscriber dispatches notifications to a registered object based on its given namespace.

      +

      ActiveSupport::Subscriber is an object set to consume ActiveSupport::Notifications. The subscriber dispatches notifications to a registered object based on its given namespace.

      An example would be an Active Record subscriber responsible for collecting statistics about queries:

      diff --git a/src/7.2/classes/ActiveSupport/Testing/Deprecation.html b/src/7.2/classes/ActiveSupport/Testing/Deprecation.html index 29c9c69ff4..8ee564b5d3 100644 --- a/src/7.2/classes/ActiveSupport/Testing/Deprecation.html +++ b/src/7.2/classes/ActiveSupport/Testing/Deprecation.html @@ -82,7 +82,7 @@

      end

      -

      The match object may be a Regexp, or String appearing in the message.

      +

      The match object may be a Regexp, or String appearing in the message.

      assert_deprecated('foo', CustomDeprecator) do
         CustomDeprecator.warn "foo should no longer be used"
      diff --git a/src/7.2/classes/ActiveSupport/Testing/ErrorReporterAssertions.html b/src/7.2/classes/ActiveSupport/Testing/ErrorReporterAssertions.html
      index 06299e143d..b14d778fd8 100644
      --- a/src/7.2/classes/ActiveSupport/Testing/ErrorReporterAssertions.html
      +++ b/src/7.2/classes/ActiveSupport/Testing/ErrorReporterAssertions.html
      @@ -83,7 +83,7 @@ 

      -

      Assertion that the block should cause at least one exception to be reported to Rails.error.

      +

      Assertion that the block should cause at least one exception to be reported to Rails.error.

      Passes if the evaluated code in the yielded block reports a matching exception.

      @@ -150,7 +150,7 @@

      -

      Assertion that the block should not cause an exception to be reported to Rails.error.

      +

      Assertion that the block should not cause an exception to be reported to Rails.error.

      Passes if evaluated code in the yielded block reports no exception.

      diff --git a/src/7.2/classes/ActiveSupport/Testing/FileFixtures.html b/src/7.2/classes/ActiveSupport/Testing/FileFixtures.html index ee04d17c0e..d4ae3d6cdf 100644 --- a/src/7.2/classes/ActiveSupport/Testing/FileFixtures.html +++ b/src/7.2/classes/ActiveSupport/Testing/FileFixtures.html @@ -25,7 +25,7 @@

      Adds simple access to sample files called file fixtures. File fixtures are normal files stored in ActiveSupport::TestCase.file_fixture_path.

      -

      File fixtures are represented as Pathname objects. This makes it easy to extract specific information:

      +

      File fixtures are represented as Pathname objects. This makes it easy to extract specific information:

      file_fixture("example.txt").read # get the file's content
       file_fixture("example.mp3").size # get the file size
      @@ -78,7 +78,7 @@ 

      -

      Returns a Pathname to the fixture file named fixture_name.

      +

      Returns a Pathname to the fixture file named fixture_name.

      Raises ArgumentError if fixture_name can’t be found.

      diff --git a/src/7.2/classes/ActiveSupport/Testing/SetupAndTeardown.html b/src/7.2/classes/ActiveSupport/Testing/SetupAndTeardown.html index 7668a7673b..c16d7b54c4 100644 --- a/src/7.2/classes/ActiveSupport/Testing/SetupAndTeardown.html +++ b/src/7.2/classes/ActiveSupport/Testing/SetupAndTeardown.html @@ -23,7 +23,7 @@

      -

      Adds support for setup and teardown callbacks. These callbacks serve as a replacement to overwriting the #setup and #teardown methods of your TestCase.

      +

      Adds support for setup and teardown callbacks. These callbacks serve as a replacement to overwriting the setup and teardown methods of your TestCase.

      class ExampleTest < ActiveSupport::TestCase
         setup do
      diff --git a/src/7.2/classes/ActiveSupport/Testing/TimeHelpers.html b/src/7.2/classes/ActiveSupport/Testing/TimeHelpers.html
      index 75a5cabc1f..bd5f220075 100644
      --- a/src/7.2/classes/ActiveSupport/Testing/TimeHelpers.html
      +++ b/src/7.2/classes/ActiveSupport/Testing/TimeHelpers.html
      @@ -128,7 +128,7 @@ 

      -

      Calls travel_to with Time.now. Forwards optional with_usec argument.

      +

      Calls travel_to with Time.now. Forwards optional with_usec argument.

      Time.current # => Sun, 09 Jul 2017 15:34:49 EST -05:00
       freeze_time
      @@ -232,7 +232,7 @@ 

      -

      Returns the current time back to its original state, by removing the stubs added by travel, travel_to, and freeze_time.

      +

      Returns the current time back to its original state, by removing the stubs added by travel, travel_to, and freeze_time.

      Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00
       
      @@ -308,7 +308,7 @@ 

      DateTime.current # => Wed, 24 Nov 2004 01:04:44 -0500

      -

      Dates are taken as their timestamp at the beginning of the day in the application time zone. Time.current returns said timestamp, and Time.now its equivalent in the system time zone. Similarly, Date.current returns a date equal to the argument, and Date.today the date according to Time.now, which may be different. (Note that you rarely want to deal with Time.now, or Date.today, in order to honor the application time zone please always use Time.current and Date.current.)

      +

      Dates are taken as their timestamp at the beginning of the day in the application time zone. Time.current returns said timestamp, and Time.now its equivalent in the system time zone. Similarly, Date.current returns a date equal to the argument, and Date.today the date according to Time.now, which may be different. (Note that you rarely want to deal with Time.now, or Date.today, in order to honor the application time zone please always use Time.current and Date.current.)

      Note that the usec for the time passed will be set to 0 to prevent rounding errors with external services, like MySQL (which will round instead of floor, leading to off-by-one-second errors), unless the with_usec argument is set to true.

      diff --git a/src/7.2/classes/ActiveSupport/TimeWithZone.html b/src/7.2/classes/ActiveSupport/TimeWithZone.html index b803d1d61a..80cb1140eb 100644 --- a/src/7.2/classes/ActiveSupport/TimeWithZone.html +++ b/src/7.2/classes/ActiveSupport/TimeWithZone.html @@ -33,7 +33,7 @@

      A

      A Time-like class that can represent a time in any time zone. Necessary because standard Ruby Time instances are limited to UTC and the system’s ENV['TZ'] zone.

      -

      You shouldn’t ever need to create a TimeWithZone instance directly via new. Instead use methods local, parse, at, and now on TimeZone instances, and in_time_zone on Time and DateTime instances.

      +

      You shouldn’t ever need to create a TimeWithZone instance directly via new. Instead use methods local, parse, at, and now on TimeZone instances, and in_time_zone on Time and DateTime instances.

      Time.zone = 'Eastern Time (US & Canada)'        # => 'Eastern Time (US & Canada)'
       Time.zone.local(2007, 2, 10, 15, 30, 45)        # => Sat, 10 Feb 2007 15:30:45.000000000 EST -05:00
      @@ -854,7 +854,7 @@ 

      -

      Returns a new ActiveSupport::TimeWithZone where one or more of the elements have been changed according to the options parameter. The time options (:hour, :min, :sec, :usec, :nsec) reset cascadingly, so if only the hour is passed, then minute, sec, usec, and nsec is set to 0. If the hour and minute is passed, then sec, usec, and nsec is set to 0. The options parameter takes a hash with any of these keys: :year, :month, :day, :hour, :min, :sec, :usec, :nsec, :offset, :zone. Pass either :usec or :nsec, not both. Similarly, pass either :zone or :offset, not both.

      +

      Returns a new ActiveSupport::TimeWithZone where one or more of the elements have been changed according to the options parameter. The time options (:hour, :min, :sec, :usec, :nsec) reset cascadingly, so if only the hour is passed, then minute, sec, usec, and nsec is set to 0. If the hour and minute is passed, then sec, usec, and nsec is set to 0. The options parameter takes a hash with any of these keys: :year, :month, :day, :hour, :min, :sec, :usec, :nsec, :offset, :zone. Pass either :usec or :nsec, not both. Similarly, pass either :zone or :offset, not both.

      t = Time.zone.now          # => Fri, 14 Apr 2017 11:45:15.116992711 EST -05:00
       t.change(year: 2020)       # => Tue, 14 Apr 2020 11:45:15.116992711 EST -05:00
      @@ -1403,7 +1403,7 @@ 

      -

      Returns the simultaneous time in Time.zone, or the specified zone.

      +

      Returns the simultaneous time in Time.zone, or the specified zone.

      @@ -1591,7 +1591,7 @@

      -

      Returns a Time instance of the simultaneous time in the system timezone.

      +

      Returns a Time instance of the simultaneous time in the system timezone.

      @@ -1700,7 +1700,7 @@

      -

      Send the missing method to time instance, and wrap result in a new TimeWithZone with the existing time_zone.

      +

      Send the missing method to time instance, and wrap result in a new TimeWithZone with the existing time_zone.

      @@ -2083,7 +2083,7 @@

      -

      Returns a Time instance that represents the time in time_zone.

      +

      Returns a Time instance that represents the time in time_zone.

      @@ -2261,7 +2261,7 @@

      Returns a string of the object’s date and time.

      -

      This method is aliased to to_formatted_s.

      +

      This method is aliased to to_formatted_s.

      Accepts an optional format:

      • @@ -2431,7 +2431,7 @@

        -

        Returns an instance of Time, either with the same UTC offset as self or in the local system timezone depending on the setting of ActiveSupport.to_time_preserves_timezone.

        +

        Returns an instance of Time, either with the same UTC offset as self or in the local system timezone depending on the setting of ActiveSupport.to_time_preserves_timezone.

        @@ -2569,7 +2569,7 @@

        -

        Returns a Time instance of the simultaneous time in the UTC timezone.

        +

        Returns a Time instance of the simultaneous time in the UTC timezone.

        diff --git a/src/7.2/classes/ActiveSupport/TimeZone.html b/src/7.2/classes/ActiveSupport/TimeZone.html index ee67750f94..860d811d27 100644 --- a/src/7.2/classes/ActiveSupport/TimeZone.html +++ b/src/7.2/classes/ActiveSupport/TimeZone.html @@ -42,7 +42,7 @@

        Active Sup

        Create ActiveSupport::TimeWithZone instances via TimeZone’s local, parse, at, and now methods.

      -

      If you set config.time_zone in the Rails Application, you can access this TimeZone object via Time.zone:

      +

      If you set config.time_zone in the Rails Application, you can access this TimeZone object via Time.zone:

      # application.rb:
       class Application < Rails::Application
      diff --git a/src/7.2/classes/Array.html b/src/7.2/classes/Array.html
      index 641ec69939..702ebcbb03 100644
      --- a/src/7.2/classes/Array.html
      +++ b/src/7.2/classes/Array.html
      @@ -211,9 +211,9 @@ 

      This method is similar in purpose to Kernel#Array, but there are some differences:

      • -

        If the argument responds to to_ary the method is invoked. Kernel#Array moves on to try to_a if the returned value is nil, but Array.wrap returns an array with the argument as its single element right away.

        +

        If the argument responds to to_ary the method is invoked. Kernel#Array moves on to try to_a if the returned value is nil, but Array.wrap returns an array with the argument as its single element right away.

      • -

        If the returned value from to_ary is neither nil nor an Array object, Kernel#Array raises an exception, while Array.wrap does not, it just returns the value.

        +

        If the returned value from to_ary is neither nil nor an Array object, Kernel#Array raises an exception, while Array.wrap does not, it just returns the value.

      • It does not call to_a on the argument, if the argument does not respond to to_ary it returns an array with the argument as its single element.

      @@ -325,7 +325,7 @@

      [ [ 0, 1 ], [ 1, 0 ] ].excluding([ [ 1, 0 ] ]) # => [ [ 0, 1 ] ]

      -

      Note: This is an optimization of Enumerable#excluding that uses Array#- instead of Array#reject for performance reasons.

      +

      Note: This is an optimization of Enumerable#excluding that uses Array#- instead of Array#reject for performance reasons.

      @@ -1121,7 +1121,7 @@

      Extends Array#to_s to convert a collection of elements into a comma separated id list if :db argument is given as the format.

      -

      This method is aliased to to_formatted_s.

      +

      This method is aliased to to_formatted_s.

      Blog.all.to_fs(:db)  # => "1,2,3"
       Blog.none.to_fs(:db) # => "null"
      @@ -1174,7 +1174,7 @@ 

      -

      Calls to_param on all its elements and joins the result with slashes. This is used by url_for in Action Pack.

      +

      Calls to_param on all its elements and joins the result with slashes. This is used by url_for in Action Pack.

      @@ -1358,9 +1358,9 @@

      -

      Returns a string that represents the array in XML by invoking to_xml on each element. Active Record collections delegate their representation in XML to this method.

      +

      Returns a string that represents the array in XML by invoking to_xml on each element. Active Record collections delegate their representation in XML to this method.

      -

      All elements are expected to respond to to_xml, if any of them does not then an exception is raised.

      +

      All elements are expected to respond to to_xml, if any of them does not then an exception is raised.

      The root node reflects the class name of the first element in plural if all elements belong to the same type and that’s not Hash:

      diff --git a/src/7.2/classes/Class.html b/src/7.2/classes/Class.html index 8f60f91e2e..5d4d966eda 100644 --- a/src/7.2/classes/Class.html +++ b/src/7.2/classes/Class.html @@ -111,7 +111,7 @@

      Examples

      In the above case as long as Subclass does not assign a value to setting by performing Subclass.setting = something, Subclass.setting would read value assigned to parent class. Once Subclass assigns a value then the value assigned by Subclass would be returned.

      -

      This matches normal Ruby method inheritance: think of writing an attribute on a subclass as overriding the reader method. However, you need to be aware when using class_attribute with mutable structures as Array or Hash. In such cases, you don’t want to do changes in place. Instead use setters:

      +

      This matches normal Ruby method inheritance: think of writing an attribute on a subclass as overriding the reader method. However, you need to be aware when using class_attribute with mutable structures as Array or Hash. In such cases, you don’t want to do changes in place. Instead use setters:

      Base.setting = []
       Base.setting                # => []
      diff --git a/src/7.2/classes/Date.html b/src/7.2/classes/Date.html
      index 4c755bd4fd..c1878fcde6 100644
      --- a/src/7.2/classes/Date.html
      +++ b/src/7.2/classes/Date.html
      @@ -274,7 +274,7 @@ 

      -

      Returns the week start (e.g. :monday) for the current request, if this has been set (via Date.beginning_of_week=). If Date.beginning_of_week has not been set for the current request, returns the week start specified in config.beginning_of_week. If no config.beginning_of_week was specified, returns :monday.

      +

      Returns the week start (e.g. :monday) for the current request, if this has been set (via Date.beginning_of_week=). If Date.beginning_of_week has not been set for the current request, returns the week start specified in config.beginning_of_week. If no config.beginning_of_week was specified, returns :monday.

      @@ -309,7 +309,7 @@

      -

      Sets Date.beginning_of_week to a week start (e.g. :monday) for current request/thread.

      +

      Sets Date.beginning_of_week to a week start (e.g. :monday) for current request/thread.

      This method accepts any of the following day symbols: :monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday

      @@ -346,7 +346,7 @@

      -

      Returns Time.zone.today when Time.zone or config.time_zone are set, otherwise just returns Date.today.

      +

      Returns Time.zone.today when Time.zone or config.time_zone are set, otherwise just returns Date.today.

      @@ -1281,7 +1281,7 @@

      Convert to a formatted string. See DATE_FORMATS for predefined formats.

      -

      This method is aliased to to_formatted_s.

      +

      This method is aliased to to_formatted_s.

      date = Date.new(2007, 11, 10)       # => Sat, 10 Nov 2007
       
      diff --git a/src/7.2/classes/DateAndTime/Calculations.html b/src/7.2/classes/DateAndTime/Calculations.html
      index 20492d2f4d..4c48b72e13 100644
      --- a/src/7.2/classes/DateAndTime/Calculations.html
      +++ b/src/7.2/classes/DateAndTime/Calculations.html
      @@ -466,7 +466,7 @@ 

      -

      Returns a Range representing the whole week of the current date/time. Week starts on start_day, default is Date.beginning_of_week or config.beginning_of_week when set.

      +

      Returns a Range representing the whole week of the current date/time. Week starts on start_day, default is Date.beginning_of_week or config.beginning_of_week when set.

      @@ -777,7 +777,7 @@

      today.beginning_of_month # => Mon, 01 Jun 2015

      -

      DateTime objects will have a time set to 0:00.

      +

      DateTime objects will have a time set to 0:00.

      now = DateTime.current # => Thu, 18 Jun 2015 15:23:13 +0000
       now.beginning_of_month # => Mon, 01 Jun 2015 00:00:00 +0000
      @@ -826,7 +826,7 @@ 

      today.beginning_of_quarter # => Wed, 01 Jul 2015

      -

      DateTime objects will have a time set to 0:00.

      +

      DateTime objects will have a time set to 0:00.

      now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000
       now.beginning_of_quarter # => Wed, 01 Jul 2015 00:00:00 +0000
      @@ -870,7 +870,7 @@ 

      -

      Returns a new date/time representing the start of this week on the given day. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. DateTime objects have their time set to 0:00.

      +

      Returns a new date/time representing the start of this week on the given day. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. DateTime objects have their time set to 0:00.

      @@ -916,7 +916,7 @@

      today.beginning_of_year # => Thu, 01 Jan 2015

      -

      DateTime objects will have a time set to 0:00.

      +

      DateTime objects will have a time set to 0:00.

      now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000
       now.beginning_of_year # => Thu, 01 Jan 2015 00:00:00 +0000
      @@ -1029,7 +1029,7 @@ 

      -

      Returns the number of days to the start of the week on the given day. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set.

      +

      Returns the number of days to the start of the week on the given day. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set.

      @@ -1111,7 +1111,7 @@

      today.end_of_quarter # => Wed, 30 Sep 2015

      -

      DateTime objects will have a time set to 23:59:59.

      +

      DateTime objects will have a time set to 23:59:59.

      now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000
       now.end_of_quarter # => Wed, 30 Sep 2015 23:59:59 +0000
      @@ -1155,7 +1155,7 @@ 

      -

      Returns a new date/time representing the end of this week on the given day. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. DateTime objects have their time set to 23:59:59.

      +

      Returns a new date/time representing the end of this week on the given day. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. DateTime objects have their time set to 23:59:59.

      @@ -1413,7 +1413,7 @@

      -

      Returns Monday of this week assuming that week starts on Monday. DateTime objects have their time set to 0:00.

      +

      Returns Monday of this week assuming that week starts on Monday. DateTime objects have their time set to 0:00.

      @@ -1626,13 +1626,13 @@

      today.next_week # => Mon, 11 May 2015

      -

      The given_day_in_next_week defaults to the beginning of the week which is determined by Date.beginning_of_week or config.beginning_of_week when set.

      +

      The given_day_in_next_week defaults to the beginning of the week which is determined by Date.beginning_of_week or config.beginning_of_week when set.

      today = Date.today       # => Thu, 07 May 2015
       today.next_week(:friday) # => Fri, 15 May 2015
       
      -

      DateTime objects have their time set to 0:00 unless same_time is true.

      +

      DateTime objects have their time set to 0:00 unless same_time is true.

      now = DateTime.current # => Thu, 07 May 2015 13:31:16 +0000
       now.next_week      # => Mon, 11 May 2015 00:00:00 +0000
      @@ -1922,7 +1922,7 @@ 

      -

      Returns a new date/time representing the given day in the previous week. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. DateTime objects have their time set to 0:00 unless same_time is true.

      +

      Returns a new date/time representing the given day in the previous week. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. DateTime objects have their time set to 0:00 unless same_time is true.

      @@ -2046,7 +2046,7 @@

      -

      Returns Sunday of this week assuming that week starts on Monday. DateTime objects have their time set to 23:59:59.

      +

      Returns Sunday of this week assuming that week starts on Monday. DateTime objects have their time set to 23:59:59.

      diff --git a/src/7.2/classes/DateAndTime/Zones.html b/src/7.2/classes/DateAndTime/Zones.html index 36a9fd8115..0dc27a98c0 100644 --- a/src/7.2/classes/DateAndTime/Zones.html +++ b/src/7.2/classes/DateAndTime/Zones.html @@ -66,16 +66,16 @@

      -

      Returns the simultaneous time in Time.zone if a zone is given or if Time.zone_default is set. Otherwise, it returns the current time.

      +

      Returns the simultaneous time in Time.zone if a zone is given or if Time.zone_default is set. Otherwise, it returns the current time.

      Time.zone = 'Hawaii'        # => 'Hawaii'
       Time.utc(2000).in_time_zone # => Fri, 31 Dec 1999 14:00:00 HST -10:00
       Date.new(2000).in_time_zone # => Sat, 01 Jan 2000 00:00:00 HST -10:00
       
      -

      This method is similar to Time#localtime, except that it uses Time.zone as the local zone instead of the operating system’s time zone.

      +

      This method is similar to Time#localtime, except that it uses Time.zone as the local zone instead of the operating system’s time zone.

      -

      You can also pass in a TimeZone instance or string that identifies a TimeZone as an argument, and the conversion will be based on that zone instead of Time.zone.

      +

      You can also pass in a TimeZone instance or string that identifies a TimeZone as an argument, and the conversion will be based on that zone instead of Time.zone.

      Time.utc(2000).in_time_zone('Alaska') # => Fri, 31 Dec 1999 15:00:00 AKST -09:00
       Date.new(2000).in_time_zone('Alaska') # => Sat, 01 Jan 2000 00:00:00 AKST -09:00
      diff --git a/src/7.2/classes/DateTime.html b/src/7.2/classes/DateTime.html
      index 4e2858ae55..2771f35e3a 100644
      --- a/src/7.2/classes/DateTime.html
      +++ b/src/7.2/classes/DateTime.html
      @@ -345,7 +345,7 @@ 

      -

      Returns Time.zone.now.to_datetime when Time.zone or config.time_zone are set, otherwise returns Time.now.to_datetime.

      +

      Returns Time.zone.now.to_datetime when Time.zone or config.time_zone are set, otherwise returns Time.now.to_datetime.

      @@ -1348,7 +1348,7 @@

      -

      Returns a Time instance of the simultaneous time in the system timezone.

      +

      Returns a Time instance of the simultaneous time in the system timezone.

      @@ -1799,7 +1799,7 @@

      Convert to a formatted string. See Time::DATE_FORMATS for predefined formats.

      -

      This method is aliased to to_formatted_s.

      +

      This method is aliased to to_formatted_s.

      Examples

      @@ -1900,7 +1900,7 @@

      -

      Either return an instance of Time with the same UTC offset as self or an instance of Time representing the same time in the local system timezone depending on the setting of on the setting of ActiveSupport.to_time_preserves_timezone.

      +

      Either return an instance of Time with the same UTC offset as self or an instance of Time representing the same time in the local system timezone depending on the setting of on the setting of ActiveSupport.to_time_preserves_timezone.

      @@ -1970,7 +1970,7 @@

      -

      Returns a Time instance of the simultaneous time in the UTC timezone.

      +

      Returns a Time instance of the simultaneous time in the UTC timezone.

      DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24))     # => Mon, 21 Feb 2005 10:11:12 -0600
       DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC
      diff --git a/src/7.2/classes/ERB/Util.html b/src/7.2/classes/ERB/Util.html
      index 9444659c56..818e83970c 100644
      --- a/src/7.2/classes/ERB/Util.html
      +++ b/src/7.2/classes/ERB/Util.html
      @@ -203,7 +203,7 @@ 

      </script>

      -

      It is necessary to raw the result of json_escape, so that quotation marks don’t get converted to &quot; entities. json_escape doesn’t automatically flag the result as HTML safe, since the raw value is unsafe to use inside HTML attributes.

      +

      It is necessary to raw the result of json_escape, so that quotation marks don’t get converted to &quot; entities. json_escape doesn’t automatically flag the result as HTML safe, since the raw value is unsafe to use inside HTML attributes.

      If your JSON is being used downstream for insertion into the DOM, be aware of whether or not it is being inserted via html(). Most jQuery plugins do this. If that is the case, be sure to html_escape or sanitize any user-generated content returned by your JSON.

      diff --git a/src/7.2/classes/Enumerable.html b/src/7.2/classes/Enumerable.html index c29b4f0b88..6d34f63c66 100644 --- a/src/7.2/classes/Enumerable.html +++ b/src/7.2/classes/Enumerable.html @@ -133,7 +133,7 @@

      -

      Returns a new Array without the blank items. Uses Object#blank? for determining if an item is blank.

      +

      Returns a new Array without the blank items. Uses Object#blank? for determining if an item is blank.

      [1, "", nil, 2, " ", [], {}, false, true].compact_blank
       # =>  [1, 2, true]
      @@ -142,7 +142,7 @@ 

      # => [1]

      -

      When called on a Hash, returns a new Hash without the blank values.

      +

      When called on a Hash, returns a new Hash without the blank values.

      { a: "", b: 1, c: nil, d: [], e: false, f: true }.compact_blank
       # => { b: 1, f: true }
      @@ -266,7 +266,7 @@ 

      -

      Returns a new Array where the order has been set to that provided in the series, based on the key of the objects in the original enumerable.

      +

      Returns a new Array where the order has been set to that provided in the series, based on the key of the objects in the original enumerable.

      [ Person.find(5), Person.find(3), Person.find(1) ].in_order_of(:id, [ 1, 5, 3 ])
       # => [ Person.find(1), Person.find(5), Person.find(3) ]
      @@ -670,7 +670,7 @@ 

      -

      Returns the sole item in the enumerable. If there are no items, or more than one item, raises Enumerable::SoleItemExpectedError.

      +

      Returns the sole item in the enumerable. If there are no items, or more than one item, raises Enumerable::SoleItemExpectedError.

      ["x"].sole          # => "x"
       Set.new.sole        # => Enumerable::SoleItemExpectedError: no item found
      diff --git a/src/7.2/classes/Hash.html b/src/7.2/classes/Hash.html
      index 3f276c0628..244ecb3143 100644
      --- a/src/7.2/classes/Hash.html
      +++ b/src/7.2/classes/Hash.html
      @@ -233,7 +233,7 @@ 

      -

      Builds a Hash from XML just like Hash.from_xml, but also allows Symbol and YAML.

      +

      Builds a Hash from XML just like Hash.from_xml, but also allows Symbol and YAML.

      @@ -282,7 +282,7 @@

      # => {"hash"=>{"foo"=>1, "bar"=>2}}

      -

      DisallowedType is raised if the XML contains attributes with type="yaml" or type="symbol". Use Hash.from_trusted_xml to parse this XML.

      +

      DisallowedType is raised if the XML contains attributes with type="yaml" or type="symbol". Use Hash.from_trusted_xml to parse this XML.

      Custom disallowed_types can also be passed in the form of an array.

      @@ -384,7 +384,7 @@

      -

      Removes all blank values from the Hash in place and returns self. Uses Object#blank? for determining if a value is blank.

      +

      Removes all blank values from the Hash in place and returns self. Uses Object#blank? for determining if a value is blank.

      h = { a: "", b: 1, c: nil, d: [], e: false, f: true }
       h.compact_blank!
      @@ -1060,7 +1060,7 @@ 

      -

      Destructive reverse_merge.

      +

      Destructive reverse_merge.

      @@ -1210,7 +1210,7 @@

      -

      Destructively converts all keys to strings. Same as stringify_keys, but modifies self.

      +

      Destructively converts all keys to strings. Same as stringify_keys, but modifies self.

      @@ -1290,7 +1290,7 @@

      -

      Destructively converts all keys to symbols, as long as they respond to to_sym. Same as symbolize_keys, but modifies self.

      +

      Destructively converts all keys to symbols, as long as they respond to to_sym. Same as symbolize_keys, but modifies self.

      @@ -1485,7 +1485,7 @@

      # => "<b>foo</b>"

    • -

      If value responds to to_xml the method is invoked with key as :root.

      +

      If value responds to to_xml the method is invoked with key as :root.

      class Foo
         def to_xml(options)
      diff --git a/src/7.2/classes/Module.html b/src/7.2/classes/Module.html
      index f6ce52908f..e86dbf2e36 100644
      --- a/src/7.2/classes/Module.html
      +++ b/src/7.2/classes/Module.html
      @@ -63,7 +63,7 @@ 

      Attribute Accessors p

      So the values are scoped within the Thread.current space under the class name of the module.

      -

      Note that it can also be scoped per-fiber if Rails.application.config.active_support.isolation_level is set to :fiber.

      +

      Note that it can also be scoped per-fiber if Rails.application.config.active_support.isolation_level is set to :fiber.

    @@ -683,7 +683,7 @@

    Options

  • :prefix - Prefixes the new method with the target name or a custom prefix

  • -

    :allow_nil - If set to true, prevents a ActiveSupport::DelegationError from being raised

    +

    :allow_nil - If set to true, prevents a ActiveSupport::DelegationError from being raised

  • :private - If set to true, changes method visibility to private

  • @@ -795,7 +795,7 @@

    Options

    User.new.age # => 2

    -

    If the target is nil and does not respond to the delegated method a ActiveSupport::DelegationError is raised. If you wish to instead return nil, use the :allow_nil option.

    +

    If the target is nil and does not respond to the delegated method a ActiveSupport::DelegationError is raised. If you wish to instead return nil, use the :allow_nil option.

    class User < ActiveRecord::Base
       has_one :profile
    @@ -894,7 +894,7 @@ 

    end

    -

    With Module#delegate_missing_to, the above is condensed to:

    +

    With Module#delegate_missing_to, the above is condensed to:

    class Partition
       delegate_missing_to :@event
    @@ -911,7 +911,7 @@ 

    The target can be anything callable within the object, e.g. instance variables, methods, constants, etc.

    -

    The delegated method must be public on the target, otherwise it will raise ActiveSupport::DelegationError. If you wish to instead return nil, use the :allow_nil option.

    +

    The delegated method must be public on the target, otherwise it will raise ActiveSupport::DelegationError. If you wish to instead return nil, use the :allow_nil option.

    The marshal_dump and _dump methods are exempt from delegation due to possible interference when calling Marshal.dump(object), should the delegation target method of object add or remove instance variables.

    @@ -1678,7 +1678,7 @@

    Account.new.user # => "DHH"

    -

    Unlike mattr_accessor, values are not shared with subclasses or parent classes. If a subclass changes the value, the parent class’ value is not changed. If the parent class changes the value, the value of subclasses is not changed.

    +

    Unlike mattr_accessor, values are not shared with subclasses or parent classes. If a subclass changes the value, the parent class’ value is not changed. If the parent class changes the value, the value of subclasses is not changed.

    class Customer < Account
     end
    diff --git a/src/7.2/classes/Object.html b/src/7.2/classes/Object.html
    index 3445e4f2ed..db4204619b 100644
    --- a/src/7.2/classes/Object.html
    +++ b/src/7.2/classes/Object.html
    @@ -203,11 +203,11 @@ 

    A class that provides the same interface as SomeClass may define a marker method named acts_like_some_class? to signal its compatibility to callers of acts_like?(:some_class).

    -

    For example, Active Support extends Date to define an acts_like_date? method, and extends Time to define acts_like_time?. As a result, developers can call x.acts_like?(:time) and x.acts_like?(:date) to test duck-type compatibility, and classes that are able to act like Time can also define an acts_like_time? method to interoperate.

    +

    For example, Active Support extends Date to define an acts_like_date? method, and extends Time to define acts_like_time?. As a result, developers can call x.acts_like?(:time) and x.acts_like?(:date) to test duck-type compatibility, and classes that are able to act like Time can also define an acts_like_time? method to interoperate.

    Note that the marker method is only expected to exist. It isn’t called, so its body or return value are irrelevant.

    -

    Example: A class that provides the same interface as String

    +

    Example: A class that provides the same interface as String

    This class may define:

    @@ -428,13 +428,13 @@

    Returns true if this object is included in the argument.

    -

    When argument is a Range, #cover? is used to properly handle inclusion check within open ranges. Otherwise, argument must be any object which responds to #include?. Usage:

    +

    When argument is a Range, cover? is used to properly handle inclusion check within open ranges. Otherwise, argument must be any object which responds to include?. Usage:

    characters = ["Konata", "Kagami", "Tsukasa"]
     "Konata".in?(characters) # => true
     
    -

    For non Range arguments, this will throw an ArgumentError if the argument doesn’t respond to #include?.

    +

    For non Range arguments, this will throw an ArgumentError if the argument doesn’t respond to include?.

    @@ -618,12 +618,12 @@

    -

    Returns the receiver if it’s included in the argument otherwise returns nil. Argument must be any object which responds to #include?. Usage:

    +

    Returns the receiver if it’s included in the argument otherwise returns nil. Argument must be any object which responds to include?. Usage:

    params[:bucket_type].presence_in %w( project calendar )
     
    -

    This will throw an ArgumentError if the argument doesn’t respond to #include?.

    +

    This will throw an ArgumentError if the argument doesn’t respond to include?.

    @return [Object]

    @@ -826,7 +826,7 @@

    @person.try { upcase.truncate(50) }
     
    -

    Please also note that try is defined on Object. Therefore, it won’t work with instances of classes that do not have Object among their ancestors, like direct subclasses of BasicObject.

    +

    Please also note that try is defined on Object. Therefore, it won’t work with instances of classes that do not have Object among their ancestors, like direct subclasses of BasicObject.

    @@ -946,9 +946,9 @@

    -

    An elegant way to factor duplication out of options passed to a series of method calls. Each method called in the block, with the block variable as the receiver, will have its options merged with the default options Hash or Hash-like object provided. Each method called on the block variable must take an options hash as its final argument.

    +

    An elegant way to factor duplication out of options passed to a series of method calls. Each method called in the block, with the block variable as the receiver, will have its options merged with the default options Hash or Hash-like object provided. Each method called on the block variable must take an options hash as its final argument.

    -

    Without with_options, this code contains duplication:

    +

    Without with_options, this code contains duplication:

    class Account < ActiveRecord::Base
       has_many :customers, dependent: :destroy
    @@ -958,7 +958,7 @@ 

    end

    -

    Using with_options, we can remove the duplication:

    +

    Using with_options, we can remove the duplication:

    class Account < ActiveRecord::Base
       with_options dependent: :destroy do |assoc|
    @@ -990,7 +990,7 @@ 

    end

    -

    with_options can also be nested since the call is forwarded to its receiver.

    +

    with_options can also be nested since the call is forwarded to its receiver.

    NOTE: Each nesting level will merge inherited defaults in addition to their own.

    @@ -1008,7 +1008,7 @@

    Hence the inherited default for if key is ignored.

    -

    NOTE: You cannot call class methods implicitly inside of with_options. You can access these methods using the class name instead:

    +

    NOTE: You cannot call class methods implicitly inside of with_options. You can access these methods using the class name instead:

    class Phone < ActiveRecord::Base
       enum :phone_number_type, { home: 0, office: 1, mobile: 2 }
    diff --git a/src/7.2/classes/Rails/Application.html b/src/7.2/classes/Rails/Application.html
    index ba1e0297bf..aeb1af9e60 100644
    --- a/src/7.2/classes/Rails/Application.html
    +++ b/src/7.2/classes/Rails/Application.html
    @@ -67,7 +67,7 @@ 

    Booting process

  • require railties and engines.

  • -

    Define Rails.application as class MyApp::Application < Rails::Application.

    +

    Define Rails.application as class MyApp::Application < Rails::Application.

  • Run config.before_configuration callbacks.

  • @@ -77,11 +77,11 @@

    Booting process

  • Run Railtie#initializer defined by railties, engines, and application. One by one, each engine sets up its load paths and routes, and runs its config/initializers/* files.

  • -

    Custom Railtie#initializers added by railties, engines, and applications are executed.

    +

    Custom Railtie#initializers added by railties, engines, and applications are executed.

  • Build the middleware stack and run to_prepare callbacks.

  • -

    Run config.before_eager_load and eager_load! if eager_load is true.

    +

    Run config.before_eager_load and eager_load! if eager_load is true.

  • Run config.after_initialize callbacks.

  • @@ -1003,7 +1003,7 @@

    -

    Sends the isolate_namespace method up to the class method.

    +

    Sends the isolate_namespace method up to the class method.

    @@ -1038,7 +1038,7 @@

    -

    Returns a key generator (ActiveSupport::CachingKeyGenerator) for a specified secret_key_base. The return value is memoized, so additional calls with the same secret_key_base will return the same key generator instance.

    +

    Returns a key generator (ActiveSupport::CachingKeyGenerator) for a specified secret_key_base. The return value is memoized, so additional calls with the same secret_key_base will return the same key generator instance.

    @@ -1143,7 +1143,7 @@

    end

    -

    Message verifiers created by this factory will always use a secret derived from secret_key_base when generating messages. clear_rotations will not affect this behavior. However, older secret_key_base values can be rotated for verifying messages:

    +

    Message verifiers created by this factory will always use a secret derived from secret_key_base when generating messages. clear_rotations will not affect this behavior. However, older secret_key_base values can be rotated for verifying messages:

    # Fall back to old `secret_key_base` when verifying messages
     config.before_initialize do |app|
    diff --git a/src/7.2/classes/Rails/Application/Configuration.html b/src/7.2/classes/Rails/Application/Configuration.html
    index 20376640d3..8d4110334f 100644
    --- a/src/7.2/classes/Rails/Application/Configuration.html
    +++ b/src/7.2/classes/Rails/Application/Configuration.html
    @@ -1766,13 +1766,13 @@ 

    Specifies what class to use to store the session. Possible values are :cache_store, :cookie_store, :mem_cache_store, a custom store, or :disabled. :disabled tells Rails not to deal with sessions.

    -

    Additional options will be set as session_options:

    +

    Additional options will be set as session_options:

    config.session_store :cookie_store, key: "_your_app_session"
     config.session_options # => {key: "_your_app_session"}
     
    -

    If a custom store is specified as a symbol, it will be resolved to the ActionDispatch::Session namespace:

    +

    If a custom store is specified as a symbol, it will be resolved to the ActionDispatch::Session namespace:

    # use ActionDispatch::Session::MyCustomStore as the session store
     config.session_store :my_custom_store
    diff --git a/src/7.2/classes/Rails/Configuration/MiddlewareStackProxy.html b/src/7.2/classes/Rails/Configuration/MiddlewareStackProxy.html
    index 4fb87a8b74..635f529f31 100644
    --- a/src/7.2/classes/Rails/Configuration/MiddlewareStackProxy.html
    +++ b/src/7.2/classes/Rails/Configuration/MiddlewareStackProxy.html
    @@ -36,12 +36,12 @@ 

    config.middleware.use Magical::Unicorns
     
    -

    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:

    +

    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 Rack::Head, Magical::Unicorns
     
    -

    There’s also insert_after which will insert a middleware after another:

    +

    There’s also insert_after which will insert a middleware after another:

    config.middleware.insert_after Rack::Head, Magical::Unicorns
     
    @@ -56,7 +56,7 @@

    config.middleware.move_before ActionDispatch::Flash, Magical::Unicorns
     
    -

    This will move the Magical::Unicorns middleware before the ActionDispatch::Flash. You can also move it after:

    +

    This will move the Magical::Unicorns middleware before the ActionDispatch::Flash. You can also move it after:

    config.middleware.move_after ActionDispatch::Flash, Magical::Unicorns
     
    diff --git a/src/7.2/classes/Rails/Engine.html b/src/7.2/classes/Rails/Engine.html index 01b7404e1d..c7154564bc 100644 --- a/src/7.2/classes/Rails/Engine.html +++ b/src/7.2/classes/Rails/Engine.html @@ -35,13 +35,13 @@

    -

    Rails::Engine allows you to wrap a specific Rails application or subset of functionality and share it with other applications or within a larger packaged application. Every Rails::Application is just an engine, which allows for simple feature and application sharing.

    +

    Rails::Engine allows you to wrap a specific Rails application or subset of functionality and share it with other applications or within a larger packaged application. Every Rails::Application is just an engine, which allows for simple feature and application sharing.

    -

    Any Rails::Engine is also a Rails::Railtie, so the same methods (like rake_tasks and generators) and configuration options that are available in railties can also be used in engines.

    +

    Any Rails::Engine is also a Rails::Railtie, so the same methods (like rake_tasks and generators) and configuration options that are available in railties can also be used in engines.

    Creating an Engine

    -

    If you want a gem to behave as an engine, you have to specify an Engine for it somewhere inside your plugin’s lib folder (similar to how we specify a Railtie):

    +

    If you want a gem to behave as an engine, you have to specify an Engine for it somewhere inside your plugin’s lib folder (similar to how we specify a Railtie):

    # lib/my_engine.rb
     module MyEngine
    @@ -123,11 +123,11 @@ 

    Paths end

    -

    The Application class adds a couple more paths to this set. And as in your Application, all folders under app are automatically added to the load path. If you have an app/services folder for example, it will be added by default.

    +

    The Application class adds a couple more paths to this set. And as in your Application, all folders under app are automatically added to the load path. If you have an app/services folder for example, it will be added by default.

    Endpoint

    -

    An engine can also be a Rack application. It can be useful if you have a Rack application that you would like to provide with some of the Engine‘s features.

    +

    An engine can also be a Rack application. It can be useful if you have a Rack application that you would like to provide with some of the Engine‘s features.

    To do that, use the ::endpoint method:

    @@ -147,7 +147,7 @@

    Endpoint

    Middleware stack

    -

    As an engine can now be a Rack endpoint, it can also have a middleware stack. The usage is exactly the same as in Application:

    +

    As an engine can now be a Rack endpoint, it can also have a middleware stack. The usage is exactly the same as in Application:

    module MyEngine
       class Engine < Rails::Engine
    @@ -176,7 +176,7 @@ 

    Mount priority

    end
    -

    MyEngine is mounted at /blog, and /blog/omg points to application’s controller. In such a situation, requests to /blog/omg will go through MyEngine, and if there is no such route in Engine‘s routes, it will be dispatched to main#omg. It’s much better to swap that:

    +

    MyEngine is mounted at /blog, and /blog/omg points to application’s controller. In such a situation, requests to /blog/omg will go through MyEngine, and if there is no such route in Engine‘s routes, it will be dispatched to main#omg. It’s much better to swap that:

    Rails.application.routes.draw do
       get "/blog/omg" => "main#omg"
    @@ -184,7 +184,7 @@ 

    Mount priority

    end
    -

    Now, Engine will get only requests that were not handled by Application.

    +

    Now, Engine will get only requests that were not handled by Application.

    Engine name

    @@ -252,7 +252,7 @@

    Isolated Using Engine’s routes outside Engine

    -

    Since you can now mount an engine inside application’s routes, you do not have direct access to Engine‘s url_helpers inside Application. When you mount an engine in an application’s routes, a special helper is created to allow you to do that. Consider such a scenario:

    +

    Since you can now mount an engine inside application’s routes, you do not have direct access to Engine‘s url_helpers inside Application. When you mount an engine in an application’s routes, a special helper is created to allow you to do that. Consider such a scenario:

    # config/routes.rb
     Rails.application.routes.draw do
    @@ -288,7 +288,7 @@ 

    Using
    form_for([my_engine, @user])
     
    -

    This code will use my_engine.user_path(@user) to generate the proper route.

    +

    This code will use user) at my_engine.user_path( to generate the proper route.

    Isolated engine’s helpers

    @@ -319,7 +319,7 @@

    Migrations & see

    Note that some of the migrations may be skipped if a migration with the same name already exists in application. In such a situation you must decide whether to leave that migration or rename the migration in the application and rerun copying migrations.

    -

    If your engine has migrations, you may also want to prepare data for the database in the db/seeds.rb file. You can load that data using the load_seed method, e.g.

    +

    If your engine has migrations, you may also want to prepare data for the database in the db/seeds.rb file. You can load that data using the load_seed method, e.g.

    MyEngine::Engine.load_seed
     
    diff --git a/src/7.2/classes/Rails/Generators/Actions.html b/src/7.2/classes/Rails/Generators/Actions.html index 2b716d5a06..b4c3c3080b 100644 --- a/src/7.2/classes/Rails/Generators/Actions.html +++ b/src/7.2/classes/Rails/Generators/Actions.html @@ -235,7 +235,7 @@

    Adds configuration code to a Rails runtime environment.

    -

    By default, adds code inside the Application class in config/application.rb so that it applies to all environments.

    +

    By default, adds code inside the Application class in config/application.rb so that it applies to all environments.

    environment %(config.asset_host = "cdn.provider.com")
     
    @@ -337,7 +337,7 @@

    Note that this method only adds the gem to the Gemfile; it does not install the gem.

    Options

    -
    :version +
    :version

    The version constraints for the gem, specified as a string or an array of strings:

    @@ -349,7 +349,7 @@

    Options

    gem "my_gem", ">= 1.1", "< 2.0"
     
    -
    :comment +

    :comment

    Outputs a comment above the gem declaration in the Gemfile.

    @@ -362,10 +362,10 @@

    Options

    # Second line. gem "my_gem"
    -
    :group +
    :group

    The gem group in the Gemfile that the gem belongs to.

    -
    :git +
    :git

    The URL of the git repository for the gem.

    @@ -749,16 +749,16 @@

    Options

    -
    :env +
    :env

    The Rails environment in which to run the command. Defaults to ENV["RAILS_ENV"] || "development".

    -
    :abort_on_failure +
    :abort_on_failure

    Whether to halt the generator if the command exits with a non-success exit status.

    -
    :capture +
    :capture

    Whether to capture and return the output of the command.

    -
    :sudo +
    :sudo

    Whether to run the command using sudo.

    @@ -816,16 +816,16 @@

    Options

    -
    :env +
    :env

    The Rails environment in which to run the task. Defaults to ENV["RAILS_ENV"] || "development".

    -
    :abort_on_failure +
    :abort_on_failure

    Whether to halt the generator if the task exits with a non-success exit status.

    -
    :capture +
    :capture

    Whether to capture and return the output of the task.

    -
    :sudo +
    :sudo

    Whether to run the task using sudo.

    diff --git a/src/7.2/classes/Rails/Paths/Root.html b/src/7.2/classes/Rails/Paths/Root.html index e678515f6e..96fee268f5 100644 --- a/src/7.2/classes/Rails/Paths/Root.html +++ b/src/7.2/classes/Rails/Paths/Root.html @@ -57,7 +57,7 @@

    root["config/routes"].inspect # => ["config/routes.rb"] -

    The add method accepts the following options as arguments: eager_load, autoload, autoload_once, and glob.

    +

    The add method accepts the following options as arguments: eager_load, autoload, autoload_once, and glob.

    Finally, the Path object also provides a few helpers:

    diff --git a/src/7.2/classes/Rails/Railtie.html b/src/7.2/classes/Rails/Railtie.html index ab468490f2..f8a8289090 100644 --- a/src/7.2/classes/Rails/Railtie.html +++ b/src/7.2/classes/Rails/Railtie.html @@ -33,7 +33,7 @@

    -

    Rails::Railtie is the core of the Rails framework and provides several hooks to extend Rails and/or modify the initialization process.

    +

    Rails::Railtie is the core of the Rails framework and provides several hooks to extend Rails and/or modify the initialization process.

    Every major component of Rails (Action Mailer, Action Controller, Active Record, etc.) implements a railtie. Each of them is responsible for their own initialization. This makes Rails itself absent of any component hooks, allowing other components to be used in place of any of the Rails defaults.

    @@ -54,7 +54,7 @@

    Creating a Railtie

    -

    To extend Rails using a railtie, create a subclass of Rails::Railtie. This class must be loaded during the Rails boot process, and is conventionally called MyNamespace::Railtie.

    +

    To extend Rails using a railtie, create a subclass of Rails::Railtie. This class must be loaded during the Rails boot process, and is conventionally called MyNamespace::Railtie.

    The following example demonstrates an extension which can be used with or without Rails.

    @@ -108,7 +108,7 @@

    Loading Rake Tasks and Generators

    -

    If your railtie has Rake tasks, you can tell Rails to load them through the method rake_tasks:

    +

    If your railtie has Rake tasks, you can tell Rails to load them through the method rake_tasks:

    class MyGem::Railtie < Rails::Railtie
       rake_tasks do
    diff --git a/src/7.2/classes/Rails/SourceAnnotationExtractor.html b/src/7.2/classes/Rails/SourceAnnotationExtractor.html
    index 66eaa3fc89..bcaad05d86 100644
    --- a/src/7.2/classes/Rails/SourceAnnotationExtractor.html
    +++ b/src/7.2/classes/Rails/SourceAnnotationExtractor.html
    @@ -295,7 +295,7 @@ 

    -

    Returns a hash that maps filenames under dir (recursively) to arrays with their annotations. Files with extensions registered in Rails::SourceAnnotationExtractor::Annotation.extensions are taken into account. Only files with annotations are included.

    +

    Returns a hash that maps filenames under dir (recursively) to arrays with their annotations. Files with extensions registered in Rails::SourceAnnotationExtractor::Annotation.extensions are taken into account. Only files with annotations are included.

    diff --git a/src/7.2/classes/String.html b/src/7.2/classes/String.html index e1817437e6..30d70654b8 100644 --- a/src/7.2/classes/String.html +++ b/src/7.2/classes/String.html @@ -307,7 +307,7 @@

    -

    Enables more predictable duck-typing on String-like classes. See Object#acts_like?.

    +

    Enables more predictable duck-typing on String-like classes. See Object#acts_like?.

    @@ -1317,7 +1317,7 @@

    Multibyte proxy

    -

    mb_chars is a multibyte safe proxy for string methods.

    +

    mb_chars is a multibyte safe proxy for string methods.

    It creates and returns an instance of the ActiveSupport::Multibyte::Chars class which encapsulates the original string. A Unicode safe version of all the String methods are defined on this proxy class. If the proxy class doesn’t respond to a certain method, it’s forwarded to the encapsulated string.

    @@ -1587,7 +1587,7 @@

    -

    safe_constantize tries to find a declared constant with the name specified in the string. It returns nil when the name is not in CamelCase or is not initialized.

    +

    safe_constantize tries to find a declared constant with the name specified in the string. It returns nil when the name is not in CamelCase or is not initialized.

    'Module'.safe_constantize  # => Module
     'Class'.safe_constantize   # => Class
    diff --git a/src/7.2/classes/Time.html b/src/7.2/classes/Time.html
    index 76846af14f..eb4e0da52d 100644
    --- a/src/7.2/classes/Time.html
    +++ b/src/7.2/classes/Time.html
    @@ -549,7 +549,7 @@ 

    -

    Returns Time.zone.now when Time.zone or config.time_zone are set, otherwise just returns Time.now.

    +

    Returns Time.zone.now when Time.zone or config.time_zone are set, otherwise just returns Time.now.

    @@ -658,7 +658,7 @@

    -

    Returns a TimeZone instance matching the time zone provided. Accepts the time zone in any format supported by Time.zone=. Returns nil for invalid time zones.

    +

    Returns a TimeZone instance matching the time zone provided. Accepts the time zone in any format supported by Time.zone=. Returns nil for invalid time zones.

    Time.find_zone "America/New_York" # => #<ActiveSupport::TimeZone @name="America/New_York" ...>
     Time.find_zone "NOT-A-TIMEZONE"   # => nil
    @@ -697,7 +697,7 @@ 

    -

    Returns a TimeZone instance matching the time zone provided. Accepts the time zone in any format supported by Time.zone=. Raises an ArgumentError for invalid time zones.

    +

    Returns a TimeZone instance matching the time zone provided. Accepts the time zone in any format supported by Time.zone=. Raises an ArgumentError for invalid time zones.

    Time.find_zone! "America/New_York" # => #<ActiveSupport::TimeZone @name="America/New_York" ...>
     Time.find_zone! "EST"              # => #<ActiveSupport::TimeZone @name="EST" ...>
    @@ -742,7 +742,7 @@ 

    -

    Creates a Time instance from an RFC 3339 string.

    +

    Creates a Time instance from an RFC 3339 string.

    Time.rfc3339('1999-12-31T14:00:00-10:00') # => 2000-01-01 00:00:00 -1000
     
    @@ -797,7 +797,7 @@

    -

    Allows override of Time.zone locally inside supplied block; resets Time.zone to existing value when done.

    +

    Allows override of Time.zone locally inside supplied block; resets Time.zone to existing value when done.

    class ApplicationController < ActionController::Base
       around_action :set_time_zone
    @@ -850,7 +850,7 @@ 

    -

    Returns the TimeZone for the current request, if this has been set (via Time.zone=). If Time.zone has not been set for the current request, returns the TimeZone specified in config.time_zone.

    +

    Returns the TimeZone for the current request, if this has been set (via Time.zone=). If Time.zone has not been set for the current request, returns the TimeZone specified in config.time_zone.

    @@ -885,7 +885,7 @@

    -

    Sets Time.zone to a TimeZone object for the current request/thread.

    +

    Sets Time.zone to a TimeZone object for the current request/thread.

    This method accepts any of the following:

    • @@ -898,7 +898,7 @@

      An identifier for a TZInfo::Timezone object (e.g., “America/New_York”).

    -

    Here’s an example of how you might set Time.zone on a per request basis and reset it when the request is done. current_user.time_zone just needs to return a string identifying the user’s preferred time zone:

    +

    Here’s an example of how you might set Time.zone on a per request basis and reset it when the request is done. current_user.time_zone just needs to return a string identifying the user’s preferred time zone:

    class ApplicationController < ActionController::Base
       around_action :set_time_zone
    @@ -2559,7 +2559,7 @@ 

    Converts to a formatted string. See DATE_FORMATS for built-in formats.

    -

    This method is aliased to to_formatted_s.

    +

    This method is aliased to to_formatted_s.

    time = Time.now                    # => 2007-01-18 06:10:17 -06:00
     
    @@ -2575,7 +2575,7 @@ 

    time.to_fs(:iso8601) # => "2007-01-18T06:10:17-06:00"

    -

    Adding your own time formats to to_fs

    +

    Adding your own time formats to to_fs

    You can add your own formats to the Time::DATE_FORMATS hash. Use the format name as the hash key and either a strftime string or Proc instance that takes a time argument as the value.

    @@ -2625,7 +2625,7 @@

    -

    Either return self or the time in the local system timezone depending on the setting of ActiveSupport.to_time_preserves_timezone.

    +

    Either return self or the time in the local system timezone depending on the setting of ActiveSupport.to_time_preserves_timezone.

    diff --git a/src/7.2/files/activemodel/README_rdoc.html b/src/7.2/files/activemodel/README_rdoc.html index 401ae40627..e6db81454d 100644 --- a/src/7.2/files/activemodel/README_rdoc.html +++ b/src/7.2/files/activemodel/README_rdoc.html @@ -32,7 +32,7 @@

    Active Model – model

    You can read more about Active Model in the Active Model Basics guide.

    -

    Prior to Rails 3.0, if a plugin or gem developer wanted to have an object interact with Action Pack helpers, it was required to either copy chunks of code from Rails, or monkey patch entire helpers to make them handle objects that did not exactly conform to the Active Record interface. This would result in code duplication and fragile applications that broke on upgrades. Active Model solves this by defining an explicit API. You can read more about the API in ActiveModel::Lint::Tests.

    +

    Prior to Rails 3.0, if a plugin or gem developer wanted to have an object interact with Action Pack helpers, it was required to either copy chunks of code from Rails, or monkey patch entire helpers to make them handle objects that did not exactly conform to the Active Record interface. This would result in code duplication and fragile applications that broke on upgrades. Active Model solves this by defining an explicit API. You can read more about the API in ActiveModel::Lint::Tests.

    Active Model provides a default module that implements the basic API required to integrate with Action Pack out of the box: ActiveModel::API.

    diff --git a/src/7.2/files/activestorage/app/models/active_storage/preview_rb.html b/src/7.2/files/activestorage/app/models/active_storage/preview_rb.html index d7f7df4dbd..6747466c1d 100644 --- a/src/7.2/files/activestorage/app/models/active_storage/preview_rb.html +++ b/src/7.2/files/activestorage/app/models/active_storage/preview_rb.html @@ -32,7 +32,7 @@

    Active Storage Preview

    A previewer extracts a preview image from a blob. Active Storage provides previewers for videos and PDFs. ActiveStorage::Previewer::VideoPreviewer is used for videos whereas ActiveStorage::Previewer::PopplerPDFPreviewer and ActiveStorage::Previewer::MuPDFPreviewer are used for PDFs. Build custom previewers by subclassing ActiveStorage::Previewer and implementing the requisite methods. Consult the ActiveStorage::Previewer documentation for more details on what’s required of previewers.

    -

    To choose the previewer for a blob, Active Storage calls accept? on each registered previewer in order. It uses the first previewer for which accept? returns true when given the blob. In a Rails application, add or remove previewers by manipulating Rails.application.config.active_storage.previewers in an initializer:

    +

    To choose the previewer for a blob, Active Storage calls accept? on each registered previewer in order. It uses the first previewer for which accept? returns true when given the blob. In a Rails application, add or remove previewers by manipulating Rails.application.config.active_storage.previewers in an initializer:

    Rails.application.config.active_storage.previewers
     # => [ ActiveStorage::Previewer::PopplerPDFPreviewer, ActiveStorage::Previewer::MuPDFPreviewer, ActiveStorage::Previewer::VideoPreviewer ]
    diff --git a/src/7.2/files/activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread_rb.html b/src/7.2/files/activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread_rb.html
    index 39795643e6..615eb37dae 100644
    --- a/src/7.2/files/activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread_rb.html
    +++ b/src/7.2/files/activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread_rb.html
    @@ -32,7 +32,7 @@ 

    Attribute Accessors per Thread

    So the values are scoped within the Thread.current space under the class name of the module.

    -

    Note that it can also be scoped per-fiber if Rails.application.config.active_support.isolation_level is set to :fiber.

    +

    Note that it can also be scoped per-fiber if Rails.application.config.active_support.isolation_level is set to :fiber.

    diff --git a/src/7.2/files/railties/RDOC_MAIN_md.html b/src/7.2/files/railties/RDOC_MAIN_md.html index a5269e23a0..b20258f164 100644 --- a/src/7.2/files/railties/RDOC_MAIN_md.html +++ b/src/7.2/files/railties/RDOC_MAIN_md.html @@ -36,7 +36,7 @@

    What’s Rails?

    Model layer

    -

    The Model layer represents the domain model (such as Account, Product, Person, Post, etc.) and encapsulates the business logic specific to your application. In Rails, database-backed model classes are derived from ActiveRecord::Base. Active Record allows you to present the data from database rows as objects and embellish these data objects 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 Active Model module.

    +

    The Model layer represents the domain model (such as Account, Product, Person, Post, etc.) and encapsulates the business logic specific to your application. In Rails, database-backed model classes are derived from ActiveRecord::Base. Active Record allows you to present the data from database rows as objects and embellish these data objects 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 Active Model module.

    View layer

    @@ -44,7 +44,7 @@

    View layer

    Controller layer

    -

    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 generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and manipulate models, and render view templates in order to generate the appropriate HTTP response. In Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and controller classes are derived from ActionController::Base. Action Dispatch and Action Controller are bundled together in Action Pack.

    +

    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 generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and manipulate models, and render view templates in order to generate the appropriate HTTP response. In Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and controller classes are derived from ActionController::Base. Action Dispatch and Action Controller are bundled together in Action Pack.

    Frameworks and libraries

    diff --git a/src/7.2/index.html b/src/7.2/index.html index a5269e23a0..b20258f164 100644 --- a/src/7.2/index.html +++ b/src/7.2/index.html @@ -36,7 +36,7 @@

    What’s Rails?

    Model layer

    -

    The Model layer represents the domain model (such as Account, Product, Person, Post, etc.) and encapsulates the business logic specific to your application. In Rails, database-backed model classes are derived from ActiveRecord::Base. Active Record allows you to present the data from database rows as objects and embellish these data objects 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 Active Model module.

    +

    The Model layer represents the domain model (such as Account, Product, Person, Post, etc.) and encapsulates the business logic specific to your application. In Rails, database-backed model classes are derived from ActiveRecord::Base. Active Record allows you to present the data from database rows as objects and embellish these data objects 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 Active Model module.

    View layer

    @@ -44,7 +44,7 @@

    View layer

    Controller layer

    -

    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 generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and manipulate models, and render view templates in order to generate the appropriate HTTP response. In Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and controller classes are derived from ActionController::Base. Action Dispatch and Action Controller are bundled together in Action Pack.

    +

    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 generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and manipulate models, and render view templates in order to generate the appropriate HTTP response. In Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and controller classes are derived from ActionController::Base. Action Dispatch and Action Controller are bundled together in Action Pack.

    Frameworks and libraries