🔗 Remove RDoc auto-link from Rails module everywhere

This commit is contained in:
zzak 2023-06-23 10:49:30 +09:00
parent 06da26afba
commit dd89f600f7
No known key found for this signature in database
GPG Key ID: 213927DFCF4FF102
95 changed files with 222 additions and 222 deletions

@ -1,8 +1,8 @@
# Action Cable Integrated WebSockets for Rails # Action Cable Integrated WebSockets for \Rails
Action Cable seamlessly integrates WebSockets with the rest of your Rails application. Action Cable seamlessly integrates WebSockets with the rest of your \Rails application.
It allows for real-time features to be written in Ruby in the same style It allows for real-time features to be written in Ruby in the same style
and form as the rest of your Rails application, while still being performant and form as the rest of your \Rails application, while still being performant
and scalable. It's a full-stack offering that provides both a client-side and scalable. It's a full-stack offering that provides both a client-side
JavaScript framework and a server-side Ruby framework. You have access to your full JavaScript framework and a server-side Ruby framework. You have access to your full
domain model written with Active Record or your ORM of choice. domain model written with Active Record or your ORM of choice.

@ -5,7 +5,7 @@ module Server
# = Action Cable \Server \Configuration # = Action Cable \Server \Configuration
# #
# An instance of this configuration object is available via ActionCable.server.config, which allows you to tweak Action Cable configuration # An instance of this configuration object is available via ActionCable.server.config, which allows you to tweak Action Cable configuration
# in a Rails config initializer. # in a \Rails config initializer.
class Configuration class Configuration
attr_accessor :logger, :log_tags attr_accessor :logger, :log_tags
attr_accessor :connection_class, :worker_pool_size attr_accessor :connection_class, :worker_pool_size

@ -5,11 +5,11 @@ module SubscriptionAdapter
# == \Test adapter for Action Cable # == \Test adapter for Action Cable
# #
# The test adapter should be used only in testing. Along with # The test adapter should be used only in testing. Along with
# ActionCable::TestHelper it makes a great tool to test your Rails application. # ActionCable::TestHelper it makes a great tool to test your \Rails application.
# #
# To use the test adapter set +adapter+ value to +test+ in your +config/cable.yml+ file. # To use the test adapter set +adapter+ value to +test+ in your +config/cable.yml+ file.
# #
# NOTE: Test adapter extends the +ActionCable::SubscriptionAdapter::Async+ adapter, # NOTE: +Test+ adapter extends the +ActionCable::SubscriptionAdapter::Async+ adapter,
# so it could be used in system tests too. # so it could be used in system tests too.
class Test < Async class Test < Async
def broadcast(channel, payload) def broadcast(channel, payload)

@ -1,6 +1,6 @@
# Action Mailbox # 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. 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.

@ -267,7 +267,7 @@ module ActionMailer
# the delivery agents. Your class should make any needed modifications directly to the passed # the delivery agents. Your class should make any needed modifications directly to the passed
# in +Mail::Message+ instance. # in +Mail::Message+ instance.
# #
# = Default Hash # = Default \Hash
# #
# Action Mailer provides some intelligent defaults for your emails, these are usually specified in a # Action Mailer provides some intelligent defaults for your emails, these are usually specified in a
# default method inside the class definition: # default method inside the class definition:
@ -316,7 +316,7 @@ module ActionMailer
# #
# config.action_mailer.default_options = { from: "no-reply@example.org" } # config.action_mailer.default_options = { from: "no-reply@example.org" }
# #
# = Callbacks # = \Callbacks
# #
# You can specify callbacks using <tt>before_action</tt> and <tt>after_action</tt> for configuring your messages, # You can specify callbacks using <tt>before_action</tt> and <tt>after_action</tt> for configuring your messages,
# and using <tt>before_deliver</tt> and <tt>after_deliver</tt> for wrapping the delivery process. # and using <tt>before_deliver</tt> and <tt>after_deliver</tt> for wrapping the delivery process.
@ -783,7 +783,7 @@ def _raise_error
# the most used headers in an email message, these are: # the most used headers in an email message, these are:
# #
# * +:subject+ - The subject of the message, if this is omitted, Action Mailer will # * +:subject+ - The subject of the message, if this is omitted, Action Mailer will
# ask the Rails I18n class for a translated +:subject+ in the scope of # ask the \Rails I18n class for a translated +:subject+ in the scope of
# <tt>[mailer_scope, action_name]</tt> or if this is missing, will translate the # <tt>[mailer_scope, action_name]</tt> or if this is missing, will translate the
# humanized version of the +action_name+ # humanized version of the +action_name+
# * +:to+ - Who the message is destined for, can be a string of addresses, or an array # * +:to+ - Who the message is destined for, can be a string of addresses, or an array
@ -929,7 +929,7 @@ def set_content_type(m, user_content_type, class_default) # :doc:
end end
end end
# Translates the +subject+ using Rails I18n class under <tt>[mailer_scope, action_name]</tt> scope. # Translates the +subject+ using \Rails I18n class under <tt>[mailer_scope, action_name]</tt> scope.
# If it does not find a translation for the +subject+ under the specified scope it will default to a # If it does not find a translation for the +subject+ under the specified scope it will default to a
# humanized version of the <tt>action_name</tt>. # humanized version of the <tt>action_name</tt>.
# If the subject has interpolations, you can pass them through the +interpolations+ parameter. # If the subject has interpolations, you can pass them through the +interpolations+ parameter.

@ -16,11 +16,11 @@ It consists of several modules:
subclassed to implement filters and actions to handle requests. The result subclassed to implement filters and actions to handle requests. The result
of an action is typically content generated from views. of an action is typically content generated from views.
With the Ruby on Rails framework, users only directly interface with the With the Ruby on \Rails framework, users only directly interface with the
Action Controller module. Necessary Action Dispatch functionality is activated Action Controller module. Necessary Action Dispatch functionality is activated
by default and Action View rendering is implicitly triggered by Action by default and Action View rendering is implicitly triggered by Action
Controller. However, these modules are designed to function on their own and Controller. However, these modules are designed to function on their own and
can be used outside of Rails. can be used outside of \Rails.
You can read more about Action Pack in the {Action Controller Overview}[https://guides.rubyonrails.org/action_controller_overview.html] guide. You can read more about Action Pack in the {Action Controller Overview}[https://guides.rubyonrails.org/action_controller_overview.html] guide.

@ -316,7 +316,7 @@ def secret_token(request)
# of this document. # of this document.
# #
# The nonce is opaque to the client. Composed of Time, and hash of Time with secret # The nonce is opaque to the client. Composed of Time, and hash of Time with secret
# key from the Rails session secret generated upon creation of project. Ensures # key from the \Rails session secret generated upon creation of project. Ensures
# the time cannot be modified by client. # the time cannot be modified by client.
def nonce(secret_key, time = Time.now) def nonce(secret_key, time = Time.now)
t = time.to_i t = time.to_i

@ -32,7 +32,7 @@ module MimeResponds
# #
# What that says is, "if the client wants HTML or JS in response to this action, just respond as we # What that says is, "if the client wants HTML or JS in response to this action, just respond as we
# would have before, but if the client wants XML, return them the list of people in XML format." # would have before, but if the client wants XML, return them the list of people in XML format."
# (Rails determines the desired response format from the HTTP Accept header submitted by the client.) # (\Rails determines the desired response format from the HTTP Accept header submitted by the client.)
# #
# Supposing you have an action that adds a new person, optionally creating their company # Supposing you have an action that adds a new person, optionally creating their company
# (by name) if it does not already exist, without web-services, it might look like this: # (by name) if it does not already exist, without web-services, it might look like this:
@ -98,7 +98,7 @@ module MimeResponds
# #
# Note that you can define your own XML parameter parser which would allow you to describe multiple entities # Note that you can define your own XML parameter parser which would allow you to describe multiple entities
# in a single request (i.e., by wrapping them all in a single root node), but if you just go with the flow # in a single request (i.e., by wrapping them all in a single root node), but if you just go with the flow
# and accept Rails' defaults, life will be much easier. # and accept \Rails' defaults, life will be much easier.
# #
# If you need to use a MIME type which isn't supported by default, you can register your own handlers in # If you need to use a MIME type which isn't supported by default, you can register your own handlers in
# +config/initializers/mime_types.rb+ as follows. # +config/initializers/mime_types.rb+ as follows.

@ -65,8 +65,8 @@ class UnsafeRedirectError < StandardError; end
# #
# === Open Redirect protection # === Open Redirect protection
# #
# By default, Rails protects against redirecting to external hosts for your app's safety, so called open redirects. # By default, \Rails protects against redirecting to external hosts for your app's safety, so called open redirects.
# Note: this was a new default in Rails 7.0, after upgrading opt-in by uncommenting the line with +raise_on_open_redirects+ in <tt>config/initializers/new_framework_defaults_7_0.rb</tt> # Note: this was a new default in \Rails 7.0, after upgrading opt-in by uncommenting the line with +raise_on_open_redirects+ in <tt>config/initializers/new_framework_defaults_7_0.rb</tt>
# #
# Here #redirect_to automatically validates the potentially-unsafe URL: # Here #redirect_to automatically validates the potentially-unsafe URL:
# #

@ -58,7 +58,7 @@ module All
# disposition: "attachment; filename=#{filename}.csv" # disposition: "attachment; filename=#{filename}.csv"
# end # end
# #
# Note that we used Mime[:csv] for the csv mime type as it comes with Rails. # Note that we used Mime[:csv] for the csv mime type as it comes with \Rails.
# For a custom renderer, you'll need to register a mime type with # For a custom renderer, you'll need to register a mime type with
# <tt>Mime::Type.register</tt>. # <tt>Mime::Type.register</tt>.
# #

@ -39,7 +39,7 @@ class InvalidCrossOriginRequest < ActionControllerError # :nodoc:
# ActionController::InvalidAuthenticityToken error on unverified requests. # ActionController::InvalidAuthenticityToken error on unverified requests.
# #
# APIs may want to disable this behavior since they are typically designed to be # APIs may want to disable this behavior since they are typically designed to be
# state-less: that is, the request API client handles the session instead of Rails. # state-less: that is, the request API client handles the session instead of \Rails.
# One way to achieve this is to use the <tt>:null_session</tt> strategy instead, # One way to achieve this is to use the <tt>:null_session</tt> strategy instead,
# which allows unverified requests to be handled, but with an empty session: # which allows unverified requests to be handled, but with an empty session:
# #

@ -239,10 +239,10 @@ def load!
# #
# == Use integration style controller tests over functional style controller tests. # == Use integration style controller tests over functional style controller tests.
# #
# Rails discourages the use of functional tests in favor of integration tests # \Rails discourages the use of functional tests in favor of integration tests
# (use ActionDispatch::IntegrationTest). # (use ActionDispatch::IntegrationTest).
# #
# New Rails applications no longer generate functional style controller tests and they should # New \Rails applications no longer generate functional style controller tests and they should
# only be used for backward compatibility. Integration style controller tests perform actual # only be used for backward compatibility. Integration style controller tests perform actual
# requests, whereas functional style controller tests merely simulate a request. Besides, # requests, whereas functional style controller tests merely simulate a request. Besides,
# integration tests are as fast as functional tests and provide lot of helpers such as +as+, # integration tests are as fast as functional tests and provide lot of helpers such as +as+,
@ -477,7 +477,7 @@ def head(action, **args)
# #
# It's not recommended to make more than one request in the same test. Instance # It's not recommended to make more than one request in the same test. Instance
# variables that are set in one request will not persist to the next request, # variables that are set in one request will not persist to the next request,
# but it's not guaranteed that all Rails internal state will be reset. Prefer # but it's not guaranteed that all \Rails internal state will be reset. Prefer
# ActionDispatch::IntegrationTest for making multiple requests in the same test. # ActionDispatch::IntegrationTest for making multiple requests in the same test.
# #
# Note that the request method is not verified. # Note that the request method is not verified.

@ -8,7 +8,7 @@ module ActionDispatch
module Session module Session
# = Action Dispatch Session \CookieStore # = Action Dispatch Session \CookieStore
# #
# This cookie-based session store is the Rails default. It is # This cookie-based session store is the \Rails default. It is
# dramatically faster than the alternatives. # dramatically faster than the alternatives.
# #
# Sessions typically contain at most a user ID and flash message; both fit # Sessions typically contain at most a user ID and flash message; both fit
@ -20,18 +20,18 @@ module Session
# #
# Your cookies will be encrypted using your application's +secret_key_base+. This # Your cookies will be encrypted using your application's +secret_key_base+. This
# goes a step further than signed cookies in that encrypted cookies cannot # goes a step further than signed cookies in that encrypted cookies cannot
# be altered or read by users. This is the default starting in Rails 4. # be altered or read by users. This is the default starting in \Rails 4.
# #
# Configure your session store in an initializer: # Configure your session store in an initializer:
# #
# Rails.application.config.session_store :cookie_store, key: '_your_app_session' # Rails.application.config.session_store :cookie_store, key: '_your_app_session'
# #
# In the development and test environments your application's +secret_key_base+ is # In the development and test environments your application's +secret_key_base+ is
# generated by Rails and stored in a temporary file in <tt>tmp/local_secret.txt</tt>. # generated by \Rails and stored in a temporary file in <tt>tmp/local_secret.txt</tt>.
# In all other environments, it is stored encrypted in the # In all other environments, it is stored encrypted in the
# <tt>config/credentials.yml.enc</tt> file. # <tt>config/credentials.yml.enc</tt> file.
# #
# If your application was not updated to Rails 5.2 defaults, the +secret_key_base+ # If your application was not updated to \Rails 5.2 defaults, the +secret_key_base+
# will be found in the old <tt>config/secrets.yml</tt> file. # will be found in the old <tt>config/secrets.yml</tt> file.
# #
# Note that changing your +secret_key_base+ will invalidate all existing session. # Note that changing your +secret_key_base+ will invalidate all existing session.

@ -8,7 +8,7 @@ module ActionDispatch
# This middleware serves static files from disk, if available. # This middleware serves static files from disk, if available.
# If no file is found, it hands off to the main app. # If no file is found, it hands off to the main app.
# #
# In Rails apps, this middleware is configured to serve assets from # In \Rails apps, this middleware is configured to serve assets from
# the +public/+ directory. # the +public/+ directory.
# #
# Only GET and HEAD requests are served. POST and other HTTP methods # Only GET and HEAD requests are served. POST and other HTTP methods

@ -760,7 +760,7 @@ def map_method(method, args, &block)
# end # end
# #
# This will create a number of routes for each of the posts and comments # This will create a number of routes for each of the posts and comments
# controller. For +Admin::PostsController+, Rails will create: # controller. For +Admin::PostsController+, \Rails will create:
# #
# GET /admin/posts # GET /admin/posts
# GET /admin/posts/new # GET /admin/posts/new
@ -1330,7 +1330,7 @@ def resource(*resources, &block)
self self
end end
# In Rails, a resourceful route provides a mapping between HTTP verbs # In \Rails, a resourceful route provides a mapping between HTTP verbs
# and URLs and controller actions. By convention, each action also maps # and URLs and controller actions. By convention, each action also maps
# to particular CRUD operations in a database. A single entry in the # to particular CRUD operations in a database. A single entry in the
# routing file, such as # routing file, such as
@ -1505,7 +1505,7 @@ def resources(*resources, &block)
# end # end
# end # end
# #
# This will enable Rails to recognize paths such as <tt>/photos/search</tt> # This will enable \Rails to recognize paths such as <tt>/photos/search</tt>
# with GET, and route to the search action of +PhotosController+. It will also # with GET, and route to the search action of +PhotosController+. It will also
# create the <tt>search_photos_url</tt> and <tt>search_photos_path</tt> # create the <tt>search_photos_url</tt> and <tt>search_photos_path</tt>
# route helpers. # route helpers.
@ -1675,7 +1675,7 @@ def match(path, *rest, &block)
end end
end end
# You can specify what Rails should route "/" to with the root method: # You can specify what \Rails should route "/" to with the root method:
# #
# root to: 'pages#main' # root to: 'pages#main'
# #
@ -1687,7 +1687,7 @@ def match(path, *rest, &block)
# #
# You should put the root route at the top of <tt>config/routes.rb</tt>, # You should put the root route at the top of <tt>config/routes.rb</tt>,
# because this means it will be matched first. As this is the most popular route # because this means it will be matched first. As this is the most popular route
# of most Rails applications, this is beneficial. # of most \Rails applications, this is beneficial.
def root(path, options = {}) def root(path, options = {})
if path.is_a?(String) if path.is_a?(String)
options[:to] = path options[:to] = path

@ -39,7 +39,7 @@ module Routing
# # => "/users/new?message=Welcome%21" # # => "/users/new?message=Welcome%21"
# #
# Notice the <tt>only_path: true</tt> part. This is because UrlFor has no # Notice the <tt>only_path: true</tt> part. This is because UrlFor has no
# information about the website hostname that your Rails app is serving. So if you # information about the website hostname that your \Rails app is serving. So if you
# want to include the hostname as well, then you must also pass the <tt>:host</tt> # want to include the hostname as well, then you must also pass the <tt>:host</tt>
# argument: # argument:
# #

@ -107,7 +107,7 @@ module ActionDispatch
# end # end
# #
# Because +ActionDispatch::SystemTestCase+ is a shim between Capybara # Because +ActionDispatch::SystemTestCase+ is a shim between Capybara
# and Rails, any driver that is supported by Capybara is supported by system # and \Rails, any driver that is supported by Capybara is supported by system
# tests as long as you include the required gems and files. # tests as long as you include the required gems and files.
class SystemTestCase < ActiveSupport::TestCase class SystemTestCase < ActiveSupport::TestCase
include Capybara::DSL include Capybara::DSL

@ -635,7 +635,7 @@ def method_missing(method, *args, &block)
# +response_parser+ defines how the response body should be parsed through # +response_parser+ defines how the response body should be parsed through
# +parsed_body+. # +parsed_body+.
# #
# Consult the Rails Testing Guide for more. # Consult the {Rails Testing Guide}[https://guides.rubyonrails.org/testing.html] for more.
class IntegrationTest < ActiveSupport::TestCase class IntegrationTest < ActiveSupport::TestCase
include TestProcess::FixtureFile include TestProcess::FixtureFile

@ -1,6 +1,6 @@
# Action Text # Action Text
Action Text brings rich text content and editing to Rails. It includes the [Trix editor](https://trix-editor.org) that handles everything from formatting to links to quotes to lists to embedded images and galleries. The rich text content generated by the Trix editor is saved in its own RichText model that's associated with any existing Active Record model in the application. Any embedded images (or other attachments) are automatically stored using Active Storage and associated with the included RichText model. Action Text brings rich text content and editing to \Rails. It includes the [Trix editor](https://trix-editor.org) that handles everything from formatting to links to quotes to lists to embedded images and galleries. The rich text content generated by the Trix editor is saved in its own RichText model that's associated with any existing Active Record model in the application. Any embedded images (or other attachments) are automatically stored using Active Storage and associated with the included RichText model.
You can read more about Action Text in the [Action Text Overview](https://guides.rubyonrails.org/action_text_overview.html) guide. You can read more about Action Text in the [Action Text Overview](https://guides.rubyonrails.org/action_text_overview.html) guide.

@ -82,8 +82,8 @@ module ActionView # :nodoc:
# #
# === Template caching # === Template caching
# #
# By default, Rails will compile each template to a method in order to render it. When you alter a template, # By default, \Rails will compile each template to a method in order to render it. When you alter a template,
# Rails will check the file's modification time and recompile it in development mode. # \Rails will check the file's modification time and recompile it in development mode.
# #
# == Builder # == Builder
# #

@ -43,7 +43,7 @@ module AssetTagHelper
# source, and include other JavaScript or CoffeeScript files inside the manifest. # source, and include other JavaScript or CoffeeScript files inside the manifest.
# #
# If the server supports HTTP Early Hints, and the +defer+ option is not # If the server supports HTTP Early Hints, and the +defer+ option is not
# enabled, Rails will push a <tt>103 Early Hints</tt> response that links # enabled, \Rails will push a <tt>103 Early Hints</tt> response that links
# to the assets. # to the assets.
# #
# ==== Options # ==== Options
@ -152,7 +152,7 @@ def javascript_include_tag(*sources)
# set <tt>extname: false</tt> in the options. # set <tt>extname: false</tt> in the options.
# You can modify the link attributes by passing a hash as the last argument. # You can modify the link attributes by passing a hash as the last argument.
# #
# If the server supports HTTP Early Hints, Rails will push a <tt>103 Early # If the server supports HTTP Early Hints, \Rails will push a <tt>103 Early
# Hints</tt> response that links to the assets. # Hints</tt> response that links to the assets.
# #
# ==== Options # ==== Options

@ -17,8 +17,8 @@ module Helpers # :nodoc:
# #
# === Using asset hosts # === Using asset hosts
# #
# By default, Rails links to these assets on the current host in the public # By default, \Rails links to these assets on the current host in the public
# folder, but you can direct Rails to link to assets from a dedicated asset # folder, but you can direct \Rails to link to assets from a dedicated asset
# server by setting <tt>ActionController::Base.asset_host</tt> in the application # server by setting <tt>ActionController::Base.asset_host</tt> in the application
# configuration, typically in <tt>config/environments/production.rb</tt>. # configuration, typically in <tt>config/environments/production.rb</tt>.
# For example, you'd define <tt>assets.example.com</tt> to be your asset # For example, you'd define <tt>assets.example.com</tt> to be your asset
@ -373,7 +373,7 @@ def stylesheet_url(source, options = {})
# image_path("http://www.example.com/img/edit.png") # => "http://www.example.com/img/edit.png" # 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. # 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 # The alias +path_to_image+ is provided to avoid that. \Rails uses the alias internally, and
# plugin authors are encouraged to do so. # plugin authors are encouraged to do so.
def image_path(source, options = {}) def image_path(source, options = {})
path_to_asset(source, { type: :image }.merge!(options)) path_to_asset(source, { type: :image }.merge!(options))

@ -11,7 +11,7 @@ module CspHelper
# <%= csp_meta_tag %> # <%= csp_meta_tag %>
# </head> # </head>
# #
# This is used by the Rails UJS helper to create dynamically # This is used by the \Rails UJS helper to create dynamically
# loaded inline <script> elements. # loaded inline <script> elements.
# #
def csp_meta_tag(**options) def csp_meta_tag(**options)

@ -72,7 +72,7 @@ module DateHelper
# distance_of_time_in_words(to_time, from_time, include_seconds: true) # => about 6 years # distance_of_time_in_words(to_time, from_time, include_seconds: true) # => about 6 years
# distance_of_time_in_words(Time.now, Time.now) # => less than a minute # distance_of_time_in_words(Time.now, Time.now) # => less than a minute
# #
# With the <tt>scope</tt> option, you can define a custom scope for Rails # With the <tt>scope</tt> option, you can define a custom scope for \Rails
# to look up the translation. # to look up the translation.
# #
# For example you can define the following in your locale (e.g. en.yml). # For example you can define the following in your locale (e.g. en.yml).
@ -217,7 +217,7 @@ def time_ago_in_words(from_time, options = {})
# * <tt>:order</tt> - Set to an array containing <tt>:day</tt>, <tt>:month</tt> and <tt>:year</tt> to # * <tt>:order</tt> - Set to an array containing <tt>:day</tt>, <tt>:month</tt> and <tt>:year</tt> to
# customize the order in which the select fields are shown. If you leave out any of the symbols, the respective # customize the order in which the select fields are shown. If you leave out any of the symbols, the respective
# select will not be shown (like when you set <tt>discard_xxx: true</tt>. Defaults to the order defined in # select will not be shown (like when you set <tt>discard_xxx: true</tt>. Defaults to the order defined in
# the respective locale (e.g. [:year, :month, :day] in the en locale that ships with Rails). # the respective locale (e.g. [:year, :month, :day] in the en locale that ships with \Rails).
# * <tt>:include_blank</tt> - Include a blank option in every select field so it's possible to set empty # * <tt>:include_blank</tt> - Include a blank option in every select field so it's possible to set empty
# dates. # dates.
# * <tt>:default</tt> - Set a default date if the affected date isn't set or is +nil+. # * <tt>:default</tt> - Set a default date if the affected date isn't set or is +nil+.

@ -6,7 +6,7 @@ module ActionView
module Helpers # :nodoc: module Helpers # :nodoc:
# = Action View Debug \Helpers # = Action View Debug \Helpers
# #
# Provides a set of methods for making it easier to debug Rails objects. # Provides a set of methods for making it easier to debug \Rails objects.
module DebugHelper module DebugHelper
include TagHelper include TagHelper

@ -29,7 +29,7 @@ module Helpers # :nodoc:
# when the form is initially displayed, input fields corresponding to attributes # when the form is initially displayed, input fields corresponding to attributes
# of the resource should show the current values of those 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 # 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 <tt>form</tt> # a number of related helper methods. +form_for+ generates an appropriate <tt>form</tt>
# tag and yields a form builder object that knows the model the form is about. # 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 # Input fields are created by calling methods defined on the form builder, which
@ -123,7 +123,7 @@ module FormHelper
# of a specific model object. # of a specific model object.
# #
# The method can be used in several slightly different ways, depending on # 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 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 # 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 # can be created by passing +form_for+ a string or symbol representing
# the object we are concerned with: # the object we are concerned with:
@ -252,7 +252,7 @@ module FormHelper
# form is going to be sent. However, further simplification is possible # 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 # 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 # to a set of RESTful routes, e.g. defined using the +resources+ method
# in <tt>config/routes.rb</tt>. In this case Rails will simply infer the # in <tt>config/routes.rb</tt>. In this case \Rails will simply infer the
# appropriate URL from the record itself. For example, # appropriate URL from the record itself. For example,
# #
# <%= form_for @post do |f| %> # <%= form_for @post do |f| %>
@ -556,7 +556,7 @@ def apply_form_for_options!(object, options) # :nodoc:
# is a _resource_. It corresponds to a set of RESTful routes, most likely # is a _resource_. It corresponds to a set of RESTful routes, most likely
# defined via +resources+ in <tt>config/routes.rb</tt>. # defined via +resources+ in <tt>config/routes.rb</tt>.
# #
# So when passing such a model record, Rails infers the URL and method. # So when passing such a model record, \Rails infers the URL and method.
# #
# <%= form_with model: @post do |form| %> # <%= form_with model: @post do |form| %>
# ... # ...
@ -619,12 +619,12 @@ def apply_form_for_options!(object, options) # :nodoc:
# * <tt>:local</tt> - Whether to use standard HTTP form submission. # * <tt>:local</tt> - Whether to use standard HTTP form submission.
# When set to <tt>true</tt>, the form is submitted via standard HTTP. # When set to <tt>true</tt>, the form is submitted via standard HTTP.
# When set to <tt>false</tt>, the form is submitted as a "remote form", which # When set to <tt>false</tt>, the form is submitted as a "remote form", which
# is handled by Rails UJS as an XHR. When unspecified, the behavior is derived # is handled by \Rails UJS as an XHR. When unspecified, the behavior is derived
# from <tt>config.action_view.form_with_generates_remote_forms</tt> where the # from <tt>config.action_view.form_with_generates_remote_forms</tt> where the
# config's value is actually the inverse of what <tt>local</tt>'s value would be. # config's value is actually the inverse of what <tt>local</tt>'s value would be.
# As of Rails 6.1, that configuration option defaults to <tt>false</tt> # As of \Rails 6.1, that configuration option defaults to <tt>false</tt>
# (which has the equivalent effect of passing <tt>local: true</tt>). # (which has the equivalent effect of passing <tt>local: true</tt>).
# In previous versions of Rails, that configuration option defaults to # In previous versions of \Rails, that configuration option defaults to
# <tt>true</tt> (the equivalent of passing <tt>local: false</tt>). # <tt>true</tt> (the equivalent of passing <tt>local: false</tt>).
# * <tt>:skip_enforcing_utf8</tt> - If set to true, a hidden input with name # * <tt>:skip_enforcing_utf8</tt> - If set to true, a hidden input with name
# utf8 is not output. # utf8 is not output.
@ -1316,7 +1316,7 @@ def text_area(object_name, method, options = {})
# ... # ...
# <% end %> # <% end %>
# #
# because parameter name repetition is precisely what Rails seeks to distinguish # because parameter name repetition is precisely what \Rails seeks to distinguish
# the elements of the array. For each item with a checked check box you # the elements of the array. For each item with a checked check box you
# get an extra ghost item with only that attribute, assigned to "0". # get an extra ghost item with only that attribute, assigned to "0".
# #
@ -2438,7 +2438,7 @@ def label(method, text = nil, options = {}, &block)
# ... # ...
# <% end %> # <% end %>
# #
# because parameter name repetition is precisely what Rails seeks to distinguish # because parameter name repetition is precisely what \Rails seeks to distinguish
# the elements of the array. For each item with a checked check box you # the elements of the array. For each item with a checked check box you
# get an extra ghost item with only that attribute, assigned to "0". # get an extra ghost item with only that attribute, assigned to "0".
# #

@ -522,9 +522,9 @@ def radio_button_tag(name, value, *args)
# submit_tag "Edit", class: "edit_button" # submit_tag "Edit", class: "edit_button"
# # => <input class="edit_button" data-disable-with="Edit" name="commit" type="submit" value="Edit" /> # # => <input class="edit_button" data-disable-with="Edit" name="commit" type="submit" value="Edit" />
# #
# ==== Deprecated: Rails UJS attributes # ==== Deprecated: \Rails UJS attributes
# #
# Prior to Rails 7, Rails shipped with the JavaScript library called @rails/ujs on by default. Following Rails 7, # Prior to \Rails 7, \Rails shipped with the JavaScript library called @rails/ujs on by default. Following \Rails 7,
# this library is no longer on by default. This library integrated with the following options: # this library is no longer on by default. This library integrated with the following options:
# #
# * <tt>confirm: 'question?'</tt> - If present the unobtrusive JavaScript # * <tt>confirm: 'question?'</tt> - If present the unobtrusive JavaScript
@ -582,9 +582,9 @@ def submit_tag(value = "Save changes", options = {})
# # <strong>Ask me!</strong> # # <strong>Ask me!</strong>
# # </button> # # </button>
# #
# ==== Deprecated: Rails UJS attributes # ==== Deprecated: \Rails UJS attributes
# #
# Prior to Rails 7, Rails shipped with a JavaScript library called @rails/ujs on by default. Following Rails 7, # Prior to \Rails 7, \Rails shipped with a JavaScript library called @rails/ujs on by default. Following \Rails 7,
# this library is no longer on by default. This library integrated with the following options: # this library is no longer on by default. This library integrated with the following options:
# #
# * <tt>confirm: 'question?'</tt> - If present, the # * <tt>confirm: 'question?'</tt> - If present, the

@ -7,7 +7,7 @@ module Helpers # :nodoc:
# = Action View Raw Output \Helpers # = Action View Raw Output \Helpers
module OutputSafetyHelper module OutputSafetyHelper
# This method outputs without escaping a string. Since escaping tags is # This method outputs without escaping a string. Since escaping tags is
# now default, this can be used when you don't want Rails to automatically # now default, this can be used when you don't want \Rails to automatically
# escape tags. This is not recommended if the data is coming from the user's # escape tags. This is not recommended if the data is coming from the user's
# input. # input.
# #

@ -261,7 +261,7 @@ def method_missing(called, *args, **options, &block)
# #
# === Legacy syntax # === Legacy syntax
# #
# The following format is for legacy syntax support. It will be deprecated in future versions of Rails. # The following format is for legacy syntax support. It will be deprecated in future versions of \Rails.
# #
# tag(name, options = nil, open = false, escape = true) # tag(name, options = nil, open = false, escape = true)
# #

@ -96,7 +96,7 @@ def _filtered_referrer # :nodoc:
# ==== Examples # ==== Examples
# #
# Because it relies on +url_for+, +link_to+ supports both older-style controller/action/id arguments # 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 # and newer RESTful routes. Current \Rails style favors RESTful routes whenever possible, so base
# your application on resources and use # your application on resources and use
# #
# link_to "Profile", profile_path(@profile) # link_to "Profile", profile_path(@profile)
@ -173,9 +173,9 @@ def _filtered_referrer # :nodoc:
# link_to "External link", "http://www.rubyonrails.org/", target: "_blank", rel: "nofollow" # link_to "External link", "http://www.rubyonrails.org/", target: "_blank", rel: "nofollow"
# # => <a href="http://www.rubyonrails.org/" target="_blank" rel="nofollow">External link</a> # # => <a href="http://www.rubyonrails.org/" target="_blank" rel="nofollow">External link</a>
# #
# ==== Deprecated: Rails UJS Attributes # ==== Deprecated: \Rails UJS Attributes
# #
# Prior to Rails 7, Rails shipped with a JavaScript library called <tt>@rails/ujs</tt> on by default. Following Rails 7, # Prior to \Rails 7, \Rails shipped with a JavaScript library called <tt>@rails/ujs</tt> on by default. Following \Rails 7,
# this library is no longer on by default. This library integrated with the following options: # this library is no longer on by default. This library integrated with the following options:
# #
# * <tt>method: symbol of HTTP verb</tt> - This modifier will dynamically # * <tt>method: symbol of HTTP verb</tt> - This modifier will dynamically
@ -201,7 +201,7 @@ def _filtered_referrer # :nodoc:
# * <tt>:disable_with</tt> - Value of this parameter will be used as the # * <tt>:disable_with</tt> - Value of this parameter will be used as the
# name for a disabled version of the link. # name for a disabled version of the link.
# #
# ===== Rails UJS Examples # ===== \Rails UJS Examples
# #
# link_to "Remove Profile", profile_path(@profile), method: :delete # link_to "Remove Profile", profile_path(@profile), method: :delete
# # => <a href="/profiles/1" rel="nofollow" data-method="delete">Remove Profile</a> # # => <a href="/profiles/1" rel="nofollow" data-method="delete">Remove Profile</a>
@ -305,9 +305,9 @@ def link_to(name = nil, options = nil, html_options = nil, &block)
# # <input name="authenticity_token" type="hidden" value="10f2163b45388899ad4d5ae948988266befcb6c3d1b2451cf657a0c293d605a6" autocomplete="off"/> # # <input name="authenticity_token" type="hidden" value="10f2163b45388899ad4d5ae948988266befcb6c3d1b2451cf657a0c293d605a6" autocomplete="off"/>
# # </form>" # # </form>"
# #
# ==== Deprecated: Rails UJS Attributes # ==== Deprecated: \Rails UJS Attributes
# #
# Prior to Rails 7, Rails shipped with a JavaScript library called <tt>@rails/ujs</tt> on by default. Following Rails 7, # Prior to \Rails 7, \Rails shipped with a JavaScript library called <tt>@rails/ujs</tt> on by default. Following \Rails 7,
# this library is no longer on by default. This library integrated with the following options: # this library is no longer on by default. This library integrated with the following options:
# #
# * <tt>:remote</tt> - If set to true, will allow <tt>@rails/ujs</tt> to control the # * <tt>:remote</tt> - If set to true, will allow <tt>@rails/ujs</tt> to control the
@ -323,7 +323,7 @@ def link_to(name = nil, options = nil, html_options = nil, &block)
# used as the value for a disabled version of the submit # used as the value for a disabled version of the submit
# button when the form is submitted. # button when the form is submitted.
# #
# ===== Rails UJS Examples # ===== \Rails UJS Examples
# #
# <%= button_to "Create", { action: "create" }, remote: true, form: { "data-type" => "json" } %> # <%= button_to "Create", { action: "create" }, remote: true, form: { "data-type" => "json" } %>
# # => "<form method="post" action="/images/create" class="button_to" data-remote="true" data-type="json"> # # => "<form method="post" action="/images/create" class="button_to" data-remote="true" data-type="json">
@ -499,7 +499,7 @@ def link_to_if(condition, name, options = {}, html_options = {}, &block)
# * <tt>:reply_to</tt> - Preset the +Reply-To+ field of the email. # * <tt>:reply_to</tt> - Preset the +Reply-To+ field of the email.
# #
# ==== Obfuscation # ==== Obfuscation
# Prior to Rails 4.0, +mail_to+ provided options for encoding the address # 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, # in order to hinder email harvesters. To take advantage of these options,
# install the +actionview-encoded_mail_to+ gem. # install the +actionview-encoded_mail_to+ gem.
# #

@ -5,7 +5,7 @@
module ActionView module ActionView
# = Action View Log Subscriber # = Action View Log Subscriber
# #
# Provides functionality so that Rails can output logs from Action View. # Provides functionality so that \Rails can output logs from Action View.
class LogSubscriber < ActiveSupport::LogSubscriber class LogSubscriber < ActiveSupport::LogSubscriber
VIEWS_PATTERN = /^app\/views\// VIEWS_PATTERN = /^app\/views\//

@ -13,11 +13,11 @@ class Template
# === Encodings in ActionView::Template # === Encodings in ActionView::Template
# #
# ActionView::Template is one of a few sources of potential # ActionView::Template is one of a few sources of potential
# encoding issues in Rails. This is because the source for # encoding issues in \Rails. This is because the source for
# templates are usually read from disk, and Ruby (like most # templates are usually read from disk, and Ruby (like most
# encoding-aware programming languages) assumes that the # encoding-aware programming languages) assumes that the
# String retrieved through File IO is encoded in the # String retrieved through File IO is encoded in the
# <tt>default_external</tt> encoding. In Rails, the default # <tt>default_external</tt> encoding. In \Rails, the default
# <tt>default_external</tt> encoding is UTF-8. # <tt>default_external</tt> encoding is UTF-8.
# #
# As a result, if a user saves their template as ISO-8859-1 # As a result, if a user saves their template as ISO-8859-1
@ -36,13 +36,13 @@ class Template
# to the problem. # to the problem.
# 2. The user can specify the encoding using Ruby-style # 2. The user can specify the encoding using Ruby-style
# encoding comments in any template engine. If such # encoding comments in any template engine. If such
# a comment is supplied, Rails will apply that encoding # a comment is supplied, \Rails will apply that encoding
# to the resulting compiled source returned by the # to the resulting compiled source returned by the
# template handler. # template handler.
# 3. In all cases, we transcode the resulting String to # 3. In all cases, we transcode the resulting String to
# the UTF-8. # the UTF-8.
# #
# This means that other parts of Rails can always assume # This means that other parts of \Rails can always assume
# that templates are encoded in UTF-8, even if the original # that templates are encoded in UTF-8, even if the original
# source of the template was not UTF-8. # source of the template was not UTF-8.
# #
@ -53,7 +53,7 @@ class Template
# === Instructions for template handlers # === Instructions for template handlers
# #
# The easiest thing for you to do is to simply ignore # The easiest thing for you to do is to simply ignore
# encodings. Rails will hand you the template source # encodings. \Rails will hand you the template source
# as the default_internal (generally UTF-8), raising # as the default_internal (generally UTF-8), raising
# an exception for the user before sending the template # an exception for the user before sending the template
# to you if it could not determine the original encoding. # to you if it could not determine the original encoding.
@ -70,7 +70,7 @@ class Template
# you may indicate that you will handle encodings yourself # you may indicate that you will handle encodings yourself
# by implementing <tt>handles_encoding?</tt> on your handler. # by implementing <tt>handles_encoding?</tt> on your handler.
# #
# If you do, Rails will not try to encode the String # If you do, \Rails will not try to encode the String
# into the default_internal, passing you the unaltered # into the default_internal, passing you the unaltered
# bytes tagged with the assumed encoding (from # bytes tagged with the assumed encoding (from
# default_external). # default_external).

@ -10,7 +10,7 @@ that makes it easy to turn any mailing into a job for running later. That's
one of the most common jobs in a modern web application: sending emails outside one of the most common jobs in a modern web application: sending emails outside
the request-response cycle, so the user doesn't have to wait on it. the request-response cycle, so the user doesn't have to wait on it.
The main point is to ensure that all Rails apps will have a job infrastructure The main point is to ensure that all \Rails apps will have a job infrastructure
in place, even if it's in the form of an "immediate runner". We can then have in place, even if it's in the form of an "immediate runner". We can then have
framework features and other gems build on top of that, without having to worry framework features and other gems build on top of that, without having to worry
about API differences between Delayed Job and Resque. Picking your queuing about API differences between Delayed Job and Resque. Picking your queuing

@ -47,9 +47,9 @@ module ActiveJob
## ##
# :singleton-method: # :singleton-method:
# If false, Rails will preserve the legacy serialization of BigDecimal job arguments as Strings. # If false, \Rails will preserve the legacy serialization of BigDecimal job arguments as Strings.
# If true, Rails will use the new BigDecimalSerializer to (de)serialize BigDecimal losslessly. # If true, \Rails will use the new BigDecimalSerializer to (de)serialize BigDecimal losslessly.
# Legacy serialization will be removed in Rails 7.2, along with this config. # Legacy serialization will be removed in \Rails 7.2, along with this config.
singleton_class.attr_accessor :use_big_decimal_serializer singleton_class.attr_accessor :use_big_decimal_serializer
self.use_big_decimal_serializer = false self.use_big_decimal_serializer = false

@ -9,7 +9,7 @@ module QueueAdapters
# #
# Simple, efficient background processing for Ruby. Sidekiq uses threads to # Simple, efficient background processing for Ruby. Sidekiq uses threads to
# handle many jobs at the same time in the same process. It does not # handle many jobs at the same time in the same process. It does not
# require Rails but will integrate tightly with it to make background # require \Rails but will integrate tightly with it to make background
# processing dead simple. # processing dead simple.
# #
# Read more about Sidekiq {here}[http://sidekiq.org]. # Read more about Sidekiq {here}[http://sidekiq.org].

@ -10,7 +10,7 @@ module QueueAdapters
# This reduces the cost of hosting on a service like Heroku along # This reduces the cost of hosting on a service like Heroku along
# with the memory footprint of having to maintain additional jobs if # with the memory footprint of having to maintain additional jobs if
# hosting on a dedicated server. All queues can run within a # hosting on a dedicated server. All queues can run within a
# single application (e.g. Rails, Sinatra, etc.) process. # single application (e.g. \Rails, Sinatra, etc.) process.
# #
# Read more about Sucker Punch {here}[https://github.com/brandonhilkert/sucker_punch]. # Read more about Sucker Punch {here}[https://github.com/brandonhilkert/sucker_punch].
# #

@ -6,7 +6,7 @@ module QueueAdapters
# #
# The test adapter should be used only in testing. Along with # The test adapter should be used only in testing. Along with
# ActiveJob::TestCase and ActiveJob::TestHelper # ActiveJob::TestCase and ActiveJob::TestHelper
# it makes a great tool to test your Rails application. # it makes a great tool to test your \Rails application.
# #
# To use the test adapter set +queue_adapter+ config to +:test+. # To use the test adapter set +queue_adapter+ config to +:test+.
# #

@ -1,15 +1,15 @@
= Active Model -- model interfaces for Rails = Active Model -- model interfaces for \Rails
Active Model provides a known set of interfaces for usage in model classes. Active Model provides a known set of interfaces for usage in model classes.
They allow for Action Pack helpers to interact with non-Active Record models, They allow for Action Pack helpers to interact with non-Active Record models,
for example. Active Model also helps with building custom ORMs for use outside of for example. Active Model also helps with building custom ORMs for use outside of
the Rails framework. the \Rails framework.
You can read more about Active Model in the {Active Model Basics}[https://guides.rubyonrails.org/active_model_basics.html] guide. You can read more about Active Model in the {Active Model Basics}[https://guides.rubyonrails.org/active_model_basics.html] guide.
Prior to Rails 3.0, if a plugin or gem developer wanted to have an object 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 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 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 that did not exactly conform to the Active Record interface. This would result
in code duplication and fragile applications that broke on upgrades. Active 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 Model solves this by defining an explicit API. You can read more about the

@ -3,7 +3,7 @@
module ActiveModel module ActiveModel
# = Active \Model \Translation # = Active \Model \Translation
# #
# Provides integration between your object and the Rails internationalization # Provides integration between your object and the \Rails internationalization
# (i18n) framework. # (i18n) framework.
# #
# A minimal implementation could be: # A minimal implementation could be:
@ -16,7 +16,7 @@ module ActiveModel
# # => "My attribute" # # => "My attribute"
# #
# This also provides the required class methods for hooking into the # This also provides the required class methods for hooking into the
# Rails internationalization API, including being able to define a # \Rails internationalization API, including being able to define a
# class-based +i18n_scope+ and +lookup_ancestors+ to find translations in # class-based +i18n_scope+ and +lookup_ancestors+ to find translations in
# parent classes. # parent classes.
module Translation module Translation

@ -6,7 +6,7 @@ module ActiveModel
module Validations module Validations
module ClassMethods module ClassMethods
# This method is a shortcut to all default validators and any custom # This method is a shortcut to all default validators and any custom
# validator classes ending in 'Validator'. Note that Rails default # validator classes ending in 'Validator'. Note that \Rails default
# validators can be overridden inside specific classes by creating # validators can be overridden inside specific classes by creating
# custom validator classes in their place such as PresenceValidator. # custom validator classes in their place such as PresenceValidator.
# #

@ -1,4 +1,4 @@
= Active Record -- Object-relational mapping in Rails = Active Record -- Object-relational mapping in \Rails
Active Record connects classes to relational database tables to establish an Active Record connects classes to relational database tables to establish an
almost zero-configuration persistence layer for applications. The library almost zero-configuration persistence layer for applications. The library

@ -1205,7 +1205,7 @@ def association_instance_set(name, association)
# specific association types. When no option is given, the behavior is to do nothing # specific association types. When no option is given, the behavior is to do nothing
# with the associated records when destroying a record. # with the associated records when destroying a record.
# #
# Note that <tt>:dependent</tt> is implemented using Rails' callback # Note that <tt>:dependent</tt> is implemented using \Rails' callback
# system, which works by processing callbacks in order. Therefore, other # system, which works by processing callbacks in order. Therefore, other
# callbacks declared either before or after the <tt>:dependent</tt> option # callbacks declared either before or after the <tt>:dependent</tt> option
# can affect what it does. # can affect what it does.
@ -1418,7 +1418,7 @@ module ClassMethods
# [:dependent] # [:dependent]
# Controls what happens to the associated objects when # Controls what happens to the associated objects when
# their owner is destroyed. Note that these are implemented as # their owner is destroyed. Note that these are implemented as
# callbacks, and Rails executes callbacks in order. Therefore, other # callbacks, and \Rails executes callbacks in order. Therefore, other
# similar callbacks may affect the <tt>:dependent</tt> behavior, and the # similar callbacks may affect the <tt>:dependent</tt> behavior, and the
# <tt>:dependent</tt> behavior may affect other callbacks. # <tt>:dependent</tt> behavior may affect other callbacks.
# #

@ -241,7 +241,7 @@ module ActiveRecord
# #
# config.active_record.run_after_transaction_callbacks_in_order_defined = false # config.active_record.run_after_transaction_callbacks_in_order_defined = false
# #
# If +true+ (the default from Rails 7.1), callbacks are executed in the order they # If +true+ (the default from \Rails 7.1), callbacks are executed in the order they
# are defined, just like the example above. If +false+, the order is reversed, so # are defined, just like the example above. If +false+, the order is reversed, so
# +do_something_else+ is executed before +log_children+. # +do_something_else+ is executed before +log_children+.
# #

@ -93,7 +93,7 @@ def db_config
# While a thread has a connection checked out from the pool using one of the # While a thread has a connection checked out from the pool using one of the
# above three methods, that connection will automatically be the one used # above three methods, that connection will automatically be the one used
# by ActiveRecord queries executing on that thread. It is not required to # by ActiveRecord queries executing on that thread. It is not required to
# explicitly pass the checked out connection to Rails models or queries, for # explicitly pass the checked out connection to \Rails models or queries, for
# example. # example.
# #
# == Options # == Options

@ -117,7 +117,7 @@ def dbconsole(config, options = {})
## ##
# :singleton-method: # :singleton-method:
# PostgreSQL supports multiple types for DateTimes. By default, if you use +datetime+ # PostgreSQL supports multiple types for DateTimes. By default, if you use +datetime+
# in migrations, Rails will translate this to a PostgreSQL "timestamp without time zone". # in migrations, \Rails will translate this to a PostgreSQL "timestamp without time zone".
# Change this in an initializer to use another NATIVE_DATABASE_TYPES. For example, to # Change this in an initializer to use another NATIVE_DATABASE_TYPES. For example, to
# store DateTimes as "timestamp with time zone": # store DateTimes as "timestamp with time zone":
# #

@ -39,7 +39,7 @@ module ConnectionHandling
# ) # )
# #
# In case {ActiveRecord::Base.configurations}[rdoc-ref:Core.configurations] # In case {ActiveRecord::Base.configurations}[rdoc-ref:Core.configurations]
# is set (Rails automatically loads the contents of config/database.yml into it), # is set (\Rails automatically loads the contents of config/database.yml into it),
# a symbol can also be given as argument, representing a key in the # a symbol can also be given as argument, representing a key in the
# configuration hash: # configuration hash:
# #

@ -20,7 +20,7 @@ module Integration
# Indicates whether to use a stable #cache_key method that is accompanied # Indicates whether to use a stable #cache_key method that is accompanied
# by a changing version in the #cache_version method. # by a changing version in the #cache_version method.
# #
# This is +true+, by default on Rails 5.2 and above. # This is +true+, by default on \Rails 5.2 and above.
class_attribute :cache_versioning, instance_writer: false, default: false class_attribute :cache_versioning, instance_writer: false, default: false
## ##
@ -28,7 +28,7 @@ module Integration
# Indicates whether to use a stable #cache_key method that is accompanied # Indicates whether to use a stable #cache_key method that is accompanied
# by a changing version in the #cache_version method on collections. # by a changing version in the #cache_version method on collections.
# #
# This is +false+, by default until Rails 6.1. # This is +false+, by default until \Rails 6.1.
class_attribute :collection_cache_versioning, instance_writer: false, default: false class_attribute :collection_cache_versioning, instance_writer: false, default: false
end end
@ -64,7 +64,7 @@ def to_param
# Product.new.cache_key # => "products/new" # Product.new.cache_key # => "products/new"
# Product.find(5).cache_key # => "products/5" # Product.find(5).cache_key # => "products/5"
# #
# If ActiveRecord::Base.cache_versioning is turned off, as it was in Rails 5.1 and earlier, # If ActiveRecord::Base.cache_versioning is turned off, as it was in \Rails 5.1 and earlier,
# the cache key will also include a version. # the cache key will also include a version.
# #
# Product.cache_versioning = false # Product.cache_versioning = false

@ -7,7 +7,7 @@ module Middleware
# = Database Selector \Middleware # = Database Selector \Middleware
# #
# The DatabaseSelector Middleware provides a framework for automatically # The DatabaseSelector Middleware provides a framework for automatically
# swapping from the primary to the replica database connection. Rails # swapping from the primary to the replica database connection. \Rails
# provides a basic framework to determine when to swap and allows for # provides a basic framework to determine when to swap and allows for
# applications to write custom strategy classes to override the default # applications to write custom strategy classes to override the default
# behavior. # behavior.
@ -17,7 +17,7 @@ module Middleware
# resolver context class that sets a value that helps the resolver class # resolver context class that sets a value that helps the resolver class
# decide when to switch. # decide when to switch.
# #
# Rails default middleware uses the request's session to set a timestamp # \Rails default middleware uses the request's session to set a timestamp
# that informs the application when to read from a primary or read from a # that informs the application when to read from a primary or read from a
# replica. # replica.
# #

@ -5,7 +5,7 @@ module Middleware
# = Shard Selector \Middleware # = Shard Selector \Middleware
# #
# The ShardSelector Middleware provides a framework for automatically # The ShardSelector Middleware provides a framework for automatically
# swapping shards. Rails provides a basic framework to determine which # swapping shards. \Rails provides a basic framework to determine which
# shard to switch to and allows for applications to write custom strategies # shard to switch to and allows for applications to write custom strategies
# for swapping if needed. # for swapping if needed.
# #

@ -365,9 +365,9 @@ def initialize
# Migrations of that kind should raise an ActiveRecord::IrreversibleMigration # Migrations of that kind should raise an ActiveRecord::IrreversibleMigration
# exception in their +down+ method. # exception in their +down+ method.
# #
# == Running migrations from within Rails # == Running migrations from within \Rails
# #
# The Rails package has several tools to help create and apply migrations. # The \Rails package has several tools to help create and apply migrations.
# #
# To generate a new migration, you can use # To generate a new migration, you can use
# bin/rails generate migration MyNewMigration # bin/rails generate migration MyNewMigration
@ -488,7 +488,7 @@ def initialize
# #
# == Timestamped Migrations # == Timestamped Migrations
# #
# By default, Rails generates migrations that look like: # By default, \Rails generates migrations that look like:
# #
# 20080717013526_your_migration_name.rb # 20080717013526_your_migration_name.rb
# #
@ -1161,7 +1161,7 @@ def load_migration
# A migration context requires the path to the migrations is set # A migration context requires the path to the migrations is set
# in the +migrations_paths+ parameter. Optionally a +schema_migration+ # in the +migrations_paths+ parameter. Optionally a +schema_migration+
# class can be provided. Multiple database applications will instantiate # class can be provided. Multiple database applications will instantiate
# a +SchemaMigration+ object per database. From the Rake tasks, Rails will # a +SchemaMigration+ object per database. From the Rake tasks, \Rails will
# handle this for you. # handle this for you.
class MigrationContext class MigrationContext
attr_reader :migrations_paths, :schema_migration, :internal_metadata attr_reader :migrations_paths, :schema_migration, :internal_metadata

@ -9,13 +9,13 @@ module ActiveRecord
# Automatically append comments to SQL queries with runtime information tags. This can be used to trace troublesome # Automatically append comments to SQL queries with runtime information tags. This can be used to trace troublesome
# SQL statements back to the application code that generated these statements. # SQL statements back to the application code that generated these statements.
# #
# Query logs can be enabled via Rails configuration in <tt>config/application.rb</tt> or an initializer: # Query logs can be enabled via \Rails configuration in <tt>config/application.rb</tt> or an initializer:
# #
# config.active_record.query_log_tags_enabled = true # config.active_record.query_log_tags_enabled = true
# #
# By default the name of the application, the name and action of the controller, or the name of the job are logged. # By default the name of the application, the name and action of the controller, or the name of the job are logged.
# The default format is {SQLCommenter}[https://open-telemetry.github.io/opentelemetry-sqlcommenter/]. # The default format is {SQLCommenter}[https://open-telemetry.github.io/opentelemetry-sqlcommenter/].
# The tags shown in a query comment can be configured via Rails configuration: # The tags shown in a query comment can be configured via \Rails configuration:
# #
# config.active_record.query_log_tags = [ :application, :controller, :action, :job ] # config.active_record.query_log_tags = [ :application, :controller, :action, :job ]
# #
@ -38,7 +38,7 @@ module ActiveRecord
# * +job+ # * +job+
# #
# New comment tags can be defined by adding them in a +Hash+ to the tags +Array+. Tags can have dynamic content by # 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. # 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 # ActiveSupport::CurrentAttributes can be used to store application values. Tags with +nil+ values are
# omitted from the query comment. # omitted from the query comment.
# #

@ -205,7 +205,7 @@ def find_or_create_by!(attributes, &block)
# * It relies on exception handling to handle control flow, which may be marginally slower. # * It relies on exception handling to handle control flow, which may be marginally slower.
# * The primary key may auto-increment on each create, even if it fails. This can accelerate # * The primary key may auto-increment on each create, even if it fails. This can accelerate
# the problem of running out of integers, if the underlying table is still stuck on a primary # the problem of running out of integers, if the underlying table is still stuck on a primary
# key of type int (note: All Rails apps since 5.1+ have defaulted to bigint, which is not liable # key of type int (note: All \Rails apps since 5.1+ have defaulted to bigint, which is not liable
# to this problem). # to this problem).
# #
# This method will return a record if all given attributes are covered by unique constraints # This method will return a record if all given attributes are covered by unique constraints
@ -331,7 +331,7 @@ def many?
# # => "products/query-1850ab3d302391b85b8693e941286659" # # => "products/query-1850ab3d302391b85b8693e941286659"
# #
# If ActiveRecord::Base.collection_cache_versioning is turned off, as it was # If ActiveRecord::Base.collection_cache_versioning is turned off, as it was
# in Rails 6.0 and earlier, the cache key will also include a version. # in \Rails 6.0 and earlier, the cache key will also include a version.
# #
# ActiveRecord::Base.collection_cache_versioning = false # ActiveRecord::Base.collection_cache_versioning = false
# Product.where("name like ?", "%Cosmic Encounter%").cache_key # Product.where("name like ?", "%Cosmic Encounter%").cache_key

@ -8,8 +8,8 @@ module SignedId
included do included do
## ##
# :singleton-method: # :singleton-method:
# Set the secret used for the signed id verifier instance when using Active Record outside of Rails. # Set the secret used for the signed id verifier instance when using Active Record outside of \Rails.
# Within Rails, this is automatically set using the Rails application key generator. # Within \Rails, this is automatically set using the \Rails application key generator.
class_attribute :signed_id_verifier_secret, instance_writer: false class_attribute :signed_id_verifier_secret, instance_writer: false
end end
@ -66,7 +66,7 @@ def find_signed!(signed_id, purpose: nil)
end end
# The verifier instance that all signed ids are generated and verified from. By default, it'll be initialized # The verifier instance that all signed ids are generated and verified from. By default, it'll be initialized
# with the class-level +signed_id_verifier_secret+, which within Rails comes from the # with the class-level +signed_id_verifier_secret+, which within \Rails comes from the
# Rails.application.key_generator. By default, it's SHA256 for the digest and JSON for the serialization. # Rails.application.key_generator. By default, it's SHA256 for the digest and JSON for the serialization.
def signed_id_verifier def signed_id_verifier
@signed_id_verifier ||= begin @signed_id_verifier ||= begin

@ -11,11 +11,11 @@ class DatabaseNotSupported < StandardError; end # :nodoc:
# ActiveRecord::Tasks::DatabaseTasks is a utility class, which encapsulates # ActiveRecord::Tasks::DatabaseTasks is a utility class, which encapsulates
# logic behind common tasks used to manage database and migrations. # logic behind common tasks used to manage database and migrations.
# #
# The tasks defined here are used with Rails commands provided by Active Record. # The tasks defined here are used with \Rails commands provided by Active Record.
# #
# In order to use DatabaseTasks, a few config values need to be set. All the needed # In order to use DatabaseTasks, a few config values need to be set. All the needed
# config values are set by Rails already, so it's necessary to do it only if you # config values are set by \Rails already, so it's necessary to do it only if you
# want to change the defaults or when you want to use Active Record outside of Rails # want to change the defaults or when you want to use Active Record outside of \Rails
# (in such case after configuring the database tasks, you can also use the rake tasks # (in such case after configuring the database tasks, you can also use the rake tasks
# defined in Active Record). # defined in Active Record).
# #
@ -29,7 +29,7 @@ class DatabaseNotSupported < StandardError; end # :nodoc:
# * +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. # * +root+: a path to the root of the application.
# #
# Example usage of DatabaseTasks outside Rails could look as such: # Example usage of DatabaseTasks outside \Rails could look as such:
# #
# include ActiveRecord::Tasks # include ActiveRecord::Tasks
# DatabaseTasks.database_configuration = YAML.load_file('my_database_config.yml') # DatabaseTasks.database_configuration = YAML.load_file('my_database_config.yml')

@ -265,7 +265,7 @@ module ClassMethods
# When the database catches such a duplicate insertion, # When the database catches such a duplicate insertion,
# {ActiveRecord::Base#save}[rdoc-ref:Persistence#save] will raise an ActiveRecord::StatementInvalid # {ActiveRecord::Base#save}[rdoc-ref:Persistence#save] will raise an ActiveRecord::StatementInvalid
# exception. You can either choose to let this error propagate (which # exception. You can either choose to let this error propagate (which
# will result in the default Rails exception page being shown), or you # will result in the default \Rails exception page being shown), or you
# can catch it and restart the transaction (e.g. by telling the user # can catch it and restart the transaction (e.g. by telling the user
# that the title already exists, and asking them to re-enter the title). # that the title already exists, and asking them to re-enter the title).
# This technique is also known as # This technique is also known as

@ -10,7 +10,7 @@ You can read more about Active Storage in the [Active Storage Overview](https://
## Compared to other storage solutions ## 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](https://github.com/rails/rails/blob/main/activestorage/app/models/active_storage/blob.rb) and [Attachment](https://github.com/rails/rails/blob/main/activestorage/app/models/active_storage/attachment.rb) 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](https://github.com/rails/rails/blob/main/activestorage/app/models/active_storage/blob.rb) and [Attachment](https://github.com/rails/rails/blob/main/activestorage/app/models/active_storage/attachment.rb) 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).

@ -163,7 +163,7 @@ def signed_id(purpose: :blob_id, expires_in: nil)
end end
# Returns the key pointing to the file on the service that's associated with this blob. The key is the # Returns the key pointing to the file on the service that's associated with this blob. The key is the
# secure-token format from Rails in lower case. So it'll look like: xtapjjcjiudrlk3tmwyjgpuobabd. # secure-token format from \Rails in lower case. So it'll look like: xtapjjcjiudrlk3tmwyjgpuobabd.
# This key is not intended to be revealed directly to the user. # This key is not intended to be revealed directly to the user.
# Always refer to blobs using the signed_id or a verified form of the key. # Always refer to blobs using the signed_id or a verified form of the key.
def key def key

@ -13,7 +13,7 @@ module ActiveStorage::Blob::Analyzable
# first analyzer for which +accept?+ returns true when given the blob. If no registered analyzer accepts the blob, no # first analyzer for which +accept?+ returns true when given the blob. If no registered analyzer accepts the blob, no
# metadata is extracted from it. # metadata is extracted from it.
# #
# In a Rails application, add or remove analyzers by manipulating +Rails.application.config.active_storage.analyzers+ # In a \Rails application, add or remove analyzers by manipulating +Rails.application.config.active_storage.analyzers+
# in an initializer: # in an initializer:
# #
# # Add a custom analyzer for Microsoft Office documents: # # Add a custom analyzer for Microsoft Office documents:
@ -22,9 +22,9 @@ module ActiveStorage::Blob::Analyzable
# # Remove the built-in video analyzer: # # Remove the built-in video analyzer:
# Rails.application.config.active_storage.analyzers.delete ActiveStorage::Analyzer::VideoAnalyzer # Rails.application.config.active_storage.analyzers.delete ActiveStorage::Analyzer::VideoAnalyzer
# #
# Outside of a Rails application, manipulate +ActiveStorage.analyzers+ instead. # Outside of a \Rails application, manipulate +ActiveStorage.analyzers+ instead.
# #
# You won't ordinarily need to call this method from a Rails application. New blobs are automatically and asynchronously # You won't ordinarily need to call this method from a \Rails application. New blobs are automatically and asynchronously
# analyzed via #analyze_later when they're attached for the first time. # analyzed via #analyze_later when they're attached for the first time.
def analyze def analyze
update! metadata: metadata.merge(extract_metadata_via_analyzer) update! metadata: metadata.merge(extract_metadata_via_analyzer)

@ -12,7 +12,7 @@
# documentation for more details on what's required of previewers. # 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 # 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 # 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: # by manipulating +Rails.application.config.active_storage.previewers+ in an initializer:
# #
# Rails.application.config.active_storage.previewers # Rails.application.config.active_storage.previewers
@ -22,13 +22,13 @@
# Rails.application.config.active_storage.previewers << DOCXPreviewer # Rails.application.config.active_storage.previewers << DOCXPreviewer
# # => [ ActiveStorage::Previewer::PopplerPDFPreviewer, ActiveStorage::Previewer::MuPDFPreviewer, ActiveStorage::Previewer::VideoPreviewer, DOCXPreviewer ] # # => [ ActiveStorage::Previewer::PopplerPDFPreviewer, ActiveStorage::Previewer::MuPDFPreviewer, ActiveStorage::Previewer::VideoPreviewer, DOCXPreviewer ]
# #
# Outside of a Rails application, modify +ActiveStorage.previewers+ instead. # Outside of a \Rails application, modify +ActiveStorage.previewers+ instead.
# #
# The built-in previewers rely on third-party system libraries. Specifically, the built-in video previewer requires # The built-in previewers rely on third-party system libraries. Specifically, the built-in video previewer requires
# {FFmpeg}[https://www.ffmpeg.org]. Two PDF previewers are provided: one requires {Poppler}[https://poppler.freedesktop.org], # {FFmpeg}[https://www.ffmpeg.org]. Two PDF previewers are provided: one requires {Poppler}[https://poppler.freedesktop.org],
# and the other requires {muPDF}[https://mupdf.com] (version 1.8 or newer). To preview PDFs, install either Poppler or muPDF. # and the other requires {muPDF}[https://mupdf.com] (version 1.8 or newer). To preview PDFs, install either Poppler or muPDF.
# #
# These libraries are not provided by Rails. You must install them yourself to use the built-in previewers. Before you # These libraries are not provided by \Rails. You must install them yourself to use the built-in previewers. Before you
# install and use third-party software, make sure you understand the licensing implications of doing so. # install and use third-party software, make sure you understand the licensing implications of doing so.
class ActiveStorage::Preview class ActiveStorage::Preview
class UnprocessedError < StandardError; end class UnprocessedError < StandardError; end

@ -10,7 +10,7 @@ module ActiveStorage
# ActiveStorage::Analyzer::AudioAnalyzer.new(blob).metadata # ActiveStorage::Analyzer::AudioAnalyzer.new(blob).metadata
# # => { duration: 5.0, bit_rate: 320340, sample_rate: 44100 } # # => { duration: 5.0, bit_rate: 320340, sample_rate: 44100 }
# #
# This analyzer requires the {FFmpeg}[https://www.ffmpeg.org] system library, which is not provided by Rails. # This analyzer requires the {FFmpeg}[https://www.ffmpeg.org] system library, which is not provided by \Rails.
class Analyzer::AudioAnalyzer < Analyzer class Analyzer::AudioAnalyzer < Analyzer
def self.accept?(blob) def self.accept?(blob)
blob.audio? blob.audio?

@ -20,7 +20,7 @@ module ActiveStorage
# #
# When a video's angle is 90, -90, 270 or -270 degrees, its width and height are automatically swapped for convenience. # When a video's angle is 90, -90, 270 or -270 degrees, its width and height are automatically swapped for convenience.
# #
# This analyzer requires the {FFmpeg}[https://www.ffmpeg.org] system library, which is not provided by Rails. # This analyzer requires the {FFmpeg}[https://www.ffmpeg.org] system library, which is not provided by \Rails.
class Analyzer::VideoAnalyzer < Analyzer class Analyzer::VideoAnalyzer < Analyzer
def self.accept?(blob) def self.accept?(blob)
blob.video? blob.video?

@ -18,7 +18,7 @@ module ActiveStorage
# * +AzureStorage+, to manage attachments through Microsoft Azure Storage. # * +AzureStorage+, to manage attachments through Microsoft Azure Storage.
# * +Mirror+, to be able to use several services to manage attachments. # * +Mirror+, to be able to use several services to manage attachments.
# #
# Inside a Rails application, you can set-up your services through the # Inside a \Rails application, you can set-up your services through the
# generated <tt>config/storage.yml</tt> file and reference one # generated <tt>config/storage.yml</tt> file and reference one
# of the aforementioned constant under the +service+ key. For example: # of the aforementioned constant under the +service+ key. For example:
# #
@ -33,7 +33,7 @@ module ActiveStorage
# #
# config.active_storage.service = :local # config.active_storage.service = :local
# #
# If you are using Active Storage outside of a Ruby on Rails application, you # If you are using Active Storage outside of a Ruby on \Rails application, you
# can configure the service to use like this: # can configure the service to use like this:
# #
# ActiveStorage::Blob.service = ActiveStorage::Service.configure( # ActiveStorage::Blob.service = ActiveStorage::Service.configure(

@ -1,9 +1,9 @@
= Active Support -- Utility classes and Ruby extensions from Rails = Active Support -- Utility classes and Ruby extensions from \Rails
Active Support is a collection of utility classes and standard library Active Support is a collection of utility classes and standard library
extensions that were found useful for the Rails framework. These additions extensions that were found useful for the \Rails framework. These additions
reside in this package so they can be loaded as needed in Ruby projects reside in this package so they can be loaded as needed in Ruby projects
outside of Rails. outside of \Rails.
You can read more about the extensions in the {Active Support Core Extensions}[https://guides.rubyonrails.org/active_support_core_extensions.html] guide. You can read more about the extensions in the {Active Support Core Extensions}[https://guides.rubyonrails.org/active_support_core_extensions.html] guide.

@ -21,7 +21,7 @@ module ActiveSupport
# bc.add_silencer { |line| /puma|rubygems/.match?(line) } # skip any lines from puma or rubygems # bc.add_silencer { |line| /puma|rubygems/.match?(line) } # skip any lines from puma or rubygems
# bc.clean(exception.backtrace) # perform the cleanup # bc.clean(exception.backtrace) # perform the cleanup
# #
# To reconfigure an existing BacktraceCleaner (like the default one in Rails) # To reconfigure an existing BacktraceCleaner (like the default one in \Rails)
# and show as much data as possible, you can always call # and show as much data as possible, you can always call
# BacktraceCleaner#remove_silencers!, which will restore the # BacktraceCleaner#remove_silencers!, which will restore the
# backtrace to a pristine state. If you need to reconfigure an existing # backtrace to a pristine state. If you need to reconfigure an existing

@ -7,9 +7,9 @@ module Cache
# = Memory \Cache \Store # = Memory \Cache \Store
# #
# A cache store implementation which stores everything into memory in the # A cache store implementation which stores everything into memory in the
# same process. If you're running multiple Ruby on Rails server processes # same process. If you're running multiple Ruby on \Rails server processes
# (which is the case if you're using Phusion Passenger or puma clustered mode), # (which is the case if you're using Phusion Passenger or puma clustered mode),
# then this means that Rails server process instances won't be able # then this means that \Rails server process instances won't be able
# to share cache data with each other and this may not be the most # to share cache data with each other and this may not be the most
# appropriate cache in that scenario. # appropriate cache in that scenario.
# #

@ -112,7 +112,7 @@ def camelize(first_letter = :upper)
# Capitalizes all the words and replaces some characters in the string to create # Capitalizes all the words and replaces some characters in the string to create
# a nicer looking title. +titleize+ is meant for creating pretty output. It is not # a nicer looking title. +titleize+ is meant for creating pretty output. It is not
# used in the Rails internals. # used in the \Rails internals.
# #
# The trailing '_id','Id'.. can be kept and capitalized by setting the # The trailing '_id','Id'.. can be kept and capitalized by setting the
# optional parameter +keep_id_suffix+ to true. # optional parameter +keep_id_suffix+ to true.
@ -216,7 +216,7 @@ def parameterize(separator: "-", preserve_case: false, locale: nil)
ActiveSupport::Inflector.parameterize(self, separator: separator, preserve_case: preserve_case, locale: locale) ActiveSupport::Inflector.parameterize(self, separator: separator, preserve_case: preserve_case, locale: locale)
end end
# Creates the name of a table like Rails does for models to table names. This method # Creates the name of a table like \Rails does for models to table names. This method
# uses the +pluralize+ method on the last word in the string. # uses the +pluralize+ method on the last word in the string.
# #
# 'RawScaledScorer'.tableize # => "raw_scaled_scorers" # 'RawScaledScorer'.tableize # => "raw_scaled_scorers"
@ -228,7 +228,7 @@ def tableize
ActiveSupport::Inflector.tableize(self) ActiveSupport::Inflector.tableize(self)
end end
# Creates a class name from a plural table name like Rails does for table names to models. # Creates a class name from a plural table name like \Rails does for table names to models.
# Note that this returns a string and not a class. (To convert to an actual class # Note that this returns a string and not a class. (To convert to an actual class
# follow +classify+ with +constantize+.) # follow +classify+ with +constantize+.)
# #

@ -19,8 +19,8 @@ def zone
# #
# This method accepts any of the following: # This method accepts any of the following:
# #
# * A Rails TimeZone object. # * A \Rails TimeZone object.
# * An identifier for a Rails TimeZone object (e.g., "Eastern Time (US & Canada)", <tt>-5.hours</tt>). # * An identifier for a \Rails TimeZone object (e.g., "Eastern Time (US & Canada)", <tt>-5.hours</tt>).
# * A +TZInfo::Timezone+ object. # * A +TZInfo::Timezone+ object.
# * An identifier for a +TZInfo::Timezone+ object (e.g., "America/New_York"). # * An identifier for a +TZInfo::Timezone+ object (e.g., "America/New_York").
# #

@ -8,7 +8,7 @@ module ActiveSupport
# Autoload and eager load conveniences for your library. # Autoload and eager load conveniences for your library.
# #
# This module allows you to define autoloads based on # This module allows you to define autoloads based on
# Rails conventions (i.e. no need to define the path # \Rails conventions (i.e. no need to define the path
# it is automatically guessed based on the filename) # it is automatically guessed based on the filename)
# and also define a set of constants that needs to be # and also define a set of constants that needs to be
# eager loaded: # eager loaded:

@ -5,7 +5,7 @@
module ActiveSupport module ActiveSupport
# = Active Support \Deprecation # = Active Support \Deprecation
# #
# \Deprecation specifies the API used by Rails to deprecate methods, instance variables, objects, and constants. It's # \Deprecation specifies the API used by \Rails to deprecate methods, instance variables, objects, and constants. It's
# also available for gems or applications. # also available for gems or applications.
# #
# For a gem, use Deprecation.new to create a Deprecation object and store it in your module or class (in order for # For a gem, use Deprecation.new to create a Deprecation object and store it in your module or class (in order for

@ -55,7 +55,7 @@ class Deprecation
# [+stderr+] Log all deprecation warnings to <tt>$stderr</tt>. # [+stderr+] Log all deprecation warnings to <tt>$stderr</tt>.
# [+log+] Log all deprecation warnings to +Rails.logger+. # [+log+] Log all deprecation warnings to +Rails.logger+.
# [+notify+] Use +ActiveSupport::Notifications+ to notify +deprecation.rails+. # [+notify+] Use +ActiveSupport::Notifications+ to notify +deprecation.rails+.
# [+silence+] Do nothing. On Rails, set <tt>config.active_support.report_deprecations = false</tt> to disable all behaviors. # [+silence+] Do nothing. On \Rails, set <tt>config.active_support.report_deprecations = false</tt> to disable all behaviors.
# #
# Setting behaviors only affects deprecations that happen after boot time. # Setting behaviors only affects deprecations that happen after boot time.
# For more information you can read the documentation of the +behavior=+ method. # For more information you can read the documentation of the +behavior=+ method.
@ -86,7 +86,7 @@ def disallowed_behavior
# #
# Setting behaviors only affects deprecations that happen after boot time. # Setting behaviors only affects deprecations that happen after boot time.
# Deprecation warnings raised by gems are not affected by this setting # Deprecation warnings raised by gems are not affected by this setting
# because they happen before Rails boots up. # because they happen before \Rails boots up.
# #
# deprecator = ActiveSupport::Deprecation.new # deprecator = ActiveSupport::Deprecation.new
# deprecator.behavior = :stderr # deprecator.behavior = :stderr
@ -96,7 +96,7 @@ def disallowed_behavior
# # custom stuff # # custom stuff
# } # }
# #
# If you are using Rails, you can set <tt>config.active_support.report_deprecations = false</tt> to disable # If you are using \Rails, you can set <tt>config.active_support.report_deprecations = false</tt> to disable
# all deprecation behaviors. This is similar to the +silence+ option but more performant. # all deprecation behaviors. This is similar to the +silence+ option but more performant.
def behavior=(behavior) def behavior=(behavior)
@behavior = Array(behavior).map { |b| DEFAULT_BEHAVIORS[b] || arity_coerce(b) } @behavior = Array(behavior).map { |b| DEFAULT_BEHAVIORS[b] || arity_coerce(b) }

@ -5,7 +5,7 @@
module ActiveSupport module ActiveSupport
# = \File Update Checker # = \File Update Checker
# #
# FileUpdateChecker specifies the API used by Rails to watch files # FileUpdateChecker specifies the API used by \Rails to watch files
# and control reloading. The API depends on four methods: # and control reloading. The API depends on four methods:
# #
# * +initialize+ which expects two parameters and one block as # * +initialize+ which expects two parameters and one block as
@ -22,7 +22,7 @@ module ActiveSupport
# After initialization, a call to +execute_if_updated+ must execute # After initialization, a call to +execute_if_updated+ must execute
# the block only if there was really a change in the filesystem. # the block only if there was really a change in the filesystem.
# #
# This class is used by Rails to reload the I18n framework whenever # This class is used by \Rails to reload the I18n framework whenever
# they are changed upon a new request. # they are changed upon a new request.
# #
# i18n_reloader = ActiveSupport::FileUpdateChecker.new(paths) do # i18n_reloader = ActiveSupport::FileUpdateChecker.new(paths) do

@ -39,7 +39,7 @@ module ActiveSupport
# #
# but this class is intended for use cases where strings or symbols are the # but this class is intended for use cases where strings or symbols are the
# expected keys and it is convenient to understand both as the same. For # expected keys and it is convenient to understand both as the same. For
# example the +params+ hash in Ruby on Rails. # example the +params+ hash in Ruby on \Rails.
# #
# Note that core extensions define <tt>Hash#with_indifferent_access</tt>: # Note that core extensions define <tt>Hash#with_indifferent_access</tt>:
# #
@ -47,7 +47,7 @@ module ActiveSupport
# #
# which may be handy. # which may be handy.
# #
# To access this class outside of Rails, require the core extension with: # To access this class outside of \Rails, require the core extension with:
# #
# require "active_support/core_ext/hash/indifferent_access" # require "active_support/core_ext/hash/indifferent_access"
# #

@ -10,7 +10,7 @@ module ActiveSupport
# keys. The default inflections for pluralization, singularization, and # keys. The default inflections for pluralization, singularization, and
# uncountable words are kept in inflections.rb. # uncountable words are kept in inflections.rb.
# #
# The Rails core team has stated patches for the inflections library will not # The \Rails core team has stated patches for the inflections library will not
# be accepted in order to avoid breaking legacy applications which may be # be accepted in order to avoid breaking legacy applications which may be
# relying on errant inflections. If you discover an incorrect inflection and # relying on errant inflections. If you discover an incorrect inflection and
# require it for your application or wish to define rules for languages other # require it for your application or wish to define rules for languages other
@ -178,7 +178,7 @@ def downcase_first(string)
# Capitalizes all the words and replaces some characters in the string to # Capitalizes all the words and replaces some characters in the string to
# create a nicer looking title. +titleize+ is meant for creating pretty # create a nicer looking title. +titleize+ is meant for creating pretty
# output. It is not used in the Rails internals. # output. It is not used in the \Rails internals.
# #
# The trailing '_id','Id'.. can be kept and capitalized by setting the # The trailing '_id','Id'.. can be kept and capitalized by setting the
# optional parameter +keep_id_suffix+ to true. # optional parameter +keep_id_suffix+ to true.
@ -195,7 +195,7 @@ def titleize(word, keep_id_suffix: false)
end end
end end
# Creates the name of a table like Rails does for models to table names. # Creates the name of a table like \Rails does for models to table names.
# This method uses the #pluralize method on the last word in the string. # This method uses the #pluralize method on the last word in the string.
# #
# tableize('RawScaledScorer') # => "raw_scaled_scorers" # tableize('RawScaledScorer') # => "raw_scaled_scorers"
@ -205,7 +205,7 @@ def tableize(class_name)
pluralize(underscore(class_name)) pluralize(underscore(class_name))
end end
# Creates a class name from a plural table name like Rails does for table # Creates a class name from a plural table name like \Rails does for table
# names to models. Note that this returns a string and not a Class. (To # names to models. Note that this returns a string and not a Class. (To
# convert to an actual class follow +classify+ with #constantize.) # convert to an actual class follow +classify+ with #constantize.)
# #

@ -127,7 +127,7 @@ class << self
# Defaults to 3 (equivalent to millisecond precision) # Defaults to 3 (equivalent to millisecond precision)
attr_accessor :time_precision attr_accessor :time_precision
# Sets the encoder used by Rails to encode Ruby objects into JSON strings # Sets the encoder used by \Rails to encode Ruby objects into JSON strings
# in +Object#to_json+ and +ActiveSupport::JSON.encode+. # in +Object#to_json+ and +ActiveSupport::JSON.encode+.
attr_accessor :json_encoder attr_accessor :json_encoder
end end

@ -8,7 +8,7 @@ module ActiveSupport
# #
# KeyGenerator is a simple wrapper around OpenSSL's implementation of PBKDF2. # KeyGenerator is a simple wrapper around OpenSSL's implementation of PBKDF2.
# It can be used to derive a number of keys for various purposes from a given secret. # It can be used to derive a number of keys for various purposes from a given secret.
# This lets Rails applications have a single secure secret, but avoid reusing that # This lets \Rails applications have a single secure secret, but avoid reusing that
# key in multiple incompatible contexts. # key in multiple incompatible contexts.
class KeyGenerator class KeyGenerator
class << self class << self

@ -3,7 +3,7 @@
module ActiveSupport module ActiveSupport
# = Lazy Load Hooks # = Lazy Load Hooks
# #
# LazyLoadHooks allows Rails to lazily load a lot of components and thus # 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 # making the app boot faster. Because of this feature now there is no need to
# require +ActiveRecord::Base+ at boot time purely to apply # require +ActiveRecord::Base+ at boot time purely to apply
# configuration. Instead a hook is registered that applies configuration once # configuration. Instead a hook is registered that applies configuration once
@ -49,7 +49,7 @@ def self.extended(base) # :nodoc:
end end
end end
# Declares a block that will be executed when a Rails component is fully # Declares a block that will be executed when a \Rails component is fully
# loaded. If the component has already loaded, the block is executed # loaded. If the component has already loaded, the block is executed
# immediately. # immediately.
# #

@ -13,7 +13,7 @@ module ActiveSupport
# +MessageVerifier+ makes it easy to generate and verify messages which are # +MessageVerifier+ makes it easy to generate and verify messages which are
# signed to prevent tampering. # signed to prevent tampering.
# #
# In a Rails application, you can use +Rails.application.message_verifier+ # In a \Rails application, you can use +Rails.application.message_verifier+
# to manage unique instances of verifiers for each use case. # to manage unique instances of verifiers for each use case.
# {Learn more}[link:classes/Rails/Application.html#method-i-message_verifier]. # {Learn more}[link:classes/Rails/Application.html#method-i-message_verifier].
# #

@ -17,7 +17,7 @@ module ActiveSupport
# * Create ActiveSupport::TimeWithZone instances via TimeZone's +local+, # * Create ActiveSupport::TimeWithZone instances via TimeZone's +local+,
# +parse+, +at+, and +now+ methods. # +parse+, +at+, and +now+ methods.
# #
# If you set <tt>config.time_zone</tt> in the Rails Application, you can # If you set <tt>config.time_zone</tt> in the \Rails Application, you can
# access this TimeZone object via <tt>Time.zone</tt>: # access this TimeZone object via <tt>Time.zone</tt>:
# #
# # application.rb: # # application.rb:
@ -29,7 +29,7 @@ module ActiveSupport
# Time.zone.name # => "Eastern Time (US & Canada)" # Time.zone.name # => "Eastern Time (US & Canada)"
# Time.zone.now # => Sun, 18 May 2008 14:30:44 EDT -04:00 # Time.zone.now # => Sun, 18 May 2008 14:30:44 EDT -04:00
class TimeZone class TimeZone
# Keys are Rails TimeZone names, values are TZInfo identifiers. # Keys are \Rails TimeZone names, values are TZInfo identifiers.
MAPPING = { MAPPING = {
"International Date Line West" => "Etc/GMT+12", "International Date Line West" => "Etc/GMT+12",
"Midway Island" => "Pacific/Midway", "Midway Island" => "Pacific/Midway",

@ -47,10 +47,10 @@ are bundled together in [Action Pack](files/actionpack/README.rdoc).
In addition to that, \Rails also comes with: In addition to that, \Rails also comes with:
- [Action Mailer](files/actionmailer/README.rdoc), a library to generate and send emails - [Action Mailer](files/actionmailer/README.rdoc), a library to generate and send emails
- [Action Mailbox](files/actionmailbox/README.md), a library to receive emails within a Rails application - [Action Mailbox](files/actionmailbox/README.md), a library to receive emails within a \Rails application
- [Active Job](files/activejob/README.md), a framework for declaring jobs and making them run on a variety of queuing backends - [Active Job](files/activejob/README.md), a framework for declaring jobs and making them run on a variety of queuing backends
- [Action Cable](files/actioncable/README.md), a framework to integrate WebSockets with a Rails application - [Action Cable](files/actioncable/README.md), a framework to integrate WebSockets with a \Rails application
- [Active Storage](files/activestorage/README.md), a library to attach cloud and local files to Rails applications - [Active Storage](files/activestorage/README.md), a library to attach cloud and local files to \Rails applications
- [Action Text](files/actiontext/README.md), a library to handle rich text content - [Action Text](files/actiontext/README.md), a library to handle rich text content
- [Active Support](files/activesupport/README.rdoc), a collection of utility classes and standard library extensions that are useful for \Rails, and may also be used independently outside \Rails - [Active Support](files/activesupport/README.rdoc), a collection of utility classes and standard library extensions that are useful for \Rails, and may also be used independently outside \Rails

@ -1,12 +1,12 @@
= Railties -- Gluing the Engine to the Rails = Railties -- Gluing the Engine to the \Rails
Railties is responsible for gluing all frameworks together. Overall, it: Railties is responsible for gluing all frameworks together. Overall, it:
* handles the bootstrapping process for a Rails application; * handles the bootstrapping process for a \Rails application;
* manages the +rails+ command line interface; * manages the +rails+ command line interface;
* and provides the Rails generators core. * and provides the \Rails generators core.
== Download == Download
@ -30,7 +30,7 @@ API documentation is at
* https://api.rubyonrails.org * https://api.rubyonrails.org
Bug reports can be filed for the Ruby on Rails project here: Bug reports can be filed for the Ruby on \Rails project here:
* https://github.com/rails/rails/issues * https://github.com/rails/rails/issues

@ -46,7 +46,7 @@ def application
delegate :initialize!, :initialized?, to: :application delegate :initialize!, :initialized?, to: :application
# The Configuration instance used to configure the Rails environment # The Configuration instance used to configure the \Rails environment
def configuration def configuration
application.config application.config
end end
@ -55,7 +55,7 @@ def backtrace_cleaner
@backtrace_cleaner ||= Rails::BacktraceCleaner.new @backtrace_cleaner ||= Rails::BacktraceCleaner.new
end end
# Returns a Pathname object of the current Rails project, # Returns a Pathname object of the current \Rails project,
# otherwise it returns +nil+ if there is no project: # otherwise it returns +nil+ if there is no project:
# #
# Rails.root # Rails.root
@ -64,7 +64,7 @@ def root
application && application.config.root application && application.config.root
end end
# Returns the current Rails environment. # Returns the current \Rails environment.
# #
# Rails.env # => "development" # Rails.env # => "development"
# Rails.env.development? # => true # Rails.env.development? # => true
@ -73,14 +73,14 @@ def env
@_env ||= ActiveSupport::EnvironmentInquirer.new(ENV["RAILS_ENV"].presence || ENV["RACK_ENV"].presence || "development") @_env ||= ActiveSupport::EnvironmentInquirer.new(ENV["RAILS_ENV"].presence || ENV["RACK_ENV"].presence || "development")
end end
# Sets the Rails environment. # Sets the \Rails environment.
# #
# Rails.env = "staging" # => "staging" # Rails.env = "staging" # => "staging"
def env=(environment) def env=(environment)
@_env = ActiveSupport::EnvironmentInquirer.new(environment) @_env = ActiveSupport::EnvironmentInquirer.new(environment)
end end
# Returns the ActiveSupport::ErrorReporter of the current Rails project, # Returns the ActiveSupport::ErrorReporter of the current \Rails project,
# otherwise it returns +nil+ if there is no project. # otherwise it returns +nil+ if there is no project.
# #
# Rails.error.handle(IOError) do # Rails.error.handle(IOError) do
@ -91,9 +91,9 @@ def error
ActiveSupport.error_reporter ActiveSupport.error_reporter
end end
# Returns all Rails groups for loading based on: # Returns all \Rails groups for loading based on:
# #
# * The Rails environment; # * The \Rails environment;
# * The environment variable RAILS_GROUPS; # * The environment variable RAILS_GROUPS;
# * The optional envs given as argument and the hash with group dependencies; # * The optional envs given as argument and the hash with group dependencies;
# #
@ -112,7 +112,7 @@ def groups(*groups)
end end
# Returns a Pathname object of the public folder of the current # Returns a Pathname object of the public folder of the current
# Rails project, otherwise it returns +nil+ if there is no project: # \Rails project, otherwise it returns +nil+ if there is no project:
# #
# Rails.public_path # Rails.public_path
# # => #<Pathname:/Users/someuser/some/path/project/public> # # => #<Pathname:/Users/someuser/some/path/project/public>

@ -231,7 +231,7 @@ def deprecators
end end
end end
# Convenience for loading config/foo.yml for the current Rails env. # Convenience for loading config/foo.yml for the current \Rails env.
# #
# Examples: # Examples:
# #
@ -293,7 +293,7 @@ def config_for(name, env: Rails.env)
end end
end end
# Stores some of the Rails initial environment parameters which # Stores some of the \Rails initial environment parameters which
# will be used by middlewares and engines to configure themselves. # will be used by middlewares and engines to configure themselves.
def env_config def env_config
@app_env_config ||= super.merge( @app_env_config ||= super.merge(

@ -104,7 +104,7 @@ def find_by_namespace(namespace, command_name = nil) # :nodoc:
namespaces[(lookups & namespaces.keys).first] namespaces[(lookups & namespaces.keys).first]
end end
# Returns the root of the Rails engine or app running the command. # Returns the root of the \Rails engine or app running the command.
def root def root
if defined?(ENGINE_ROOT) if defined?(ENGINE_ROOT)
Pathname.new(ENGINE_ROOT) Pathname.new(ENGINE_ROOT)

@ -25,7 +25,7 @@ def exit_on_failure? # :nodoc:
false false
end end
# Returns true when the app is a Rails engine. # Returns true when the app is a \Rails engine.
def engine? def engine?
defined?(ENGINE_ROOT) defined?(ENGINE_ROOT)
end end

@ -7,11 +7,11 @@
module Rails module Rails
module Configuration module Configuration
# MiddlewareStackProxy is a proxy for the Rails middleware stack that allows # MiddlewareStackProxy is a proxy for the \Rails middleware stack that allows
# you to configure middlewares in your application. It works basically as a # you to configure middlewares in your application. It works basically as a
# command recorder, saving each command to be applied after initialization # command recorder, saving each command to be applied after initialization
# over the default middleware stack, so you can add, swap, or remove any # over the default middleware stack, so you can add, swap, or remove any
# middleware in Rails. # middleware in \Rails.
# #
# You can add your own middlewares by using the +config.middleware.use+ method: # You can add your own middlewares by using the +config.middleware.use+ method:
# #

@ -9,7 +9,7 @@
require "thread" require "thread"
module Rails module Rails
# +Rails::Engine+ allows you to wrap a specific Rails application or subset of # +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. # functionality and share it with other applications or within a larger packaged application.
# Every Rails::Application is just an engine, which allows for simple # Every Rails::Application is just an engine, which allows for simple
# feature and application sharing. # feature and application sharing.
@ -237,7 +237,7 @@ module Rails
# #
# To make this behavior consistent with other parts of the framework, # To make this behavior consistent with other parts of the framework,
# isolated engines also have an effect on ActiveModel::Naming. In a # isolated engines also have an effect on ActiveModel::Naming. In a
# normal Rails app, when you use a namespaced model such as # normal \Rails app, when you use a namespaced model such as
# +Namespace::Article+, ActiveModel::Naming will generate # +Namespace::Article+, ActiveModel::Naming will generate
# names with the prefix "namespace". In an isolated engine, the prefix will # names with the prefix "namespace". In an isolated engine, the prefix will
# be omitted in URL helpers and form fields, for convenience. # be omitted in URL helpers and form fields, for convenience.
@ -450,7 +450,7 @@ def load_console(app = self)
self self
end end
# Load Rails runner and invoke the registered hooks. # Load \Rails runner and invoke the registered hooks.
# Check Rails::Railtie.runner for more info. # Check Rails::Railtie.runner for more info.
def load_runner(app = self) def load_runner(app = self)
run_runner_blocks(app) run_runner_blocks(app)
@ -465,7 +465,7 @@ def load_tasks(app = self)
self self
end end
# Load Rails generators and invoke the registered hooks. # Load \Rails generators and invoke the registered hooks.
# Check Rails::Railtie.generators for more info. # Check Rails::Railtie.generators for more info.
def load_generators(app = self) def load_generators(app = self)
require "rails/generators" require "rails/generators"

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
module Rails module Rails
# Returns the currently loaded version of Rails as a +Gem::Version+. # Returns the currently loaded version of \Rails as a +Gem::Version+.
def self.gem_version def self.gem_version
Gem::Version.new VERSION::STRING Gem::Version.new VERSION::STRING
end end

@ -162,7 +162,7 @@ def add_source(source, options = {}, &block)
end end
end end
# Adds configuration code to a Rails runtime environment. # Adds configuration code to a \Rails runtime environment.
# #
# By default, adds code inside the +Application+ class in # By default, adds code inside the +Application+ class in
# +config/application.rb+ so that it applies to all environments. # +config/application.rb+ so that it applies to all environments.
@ -349,7 +349,7 @@ def generate(what, *args)
# ==== Options # ==== Options
# #
# [+:env+] # [+:env+]
# The Rails environment in which to run the task. Defaults to # The \Rails environment in which to run the task. Defaults to
# <tt>ENV["RAILS_ENV"] || "development"</tt>. # <tt>ENV["RAILS_ENV"] || "development"</tt>.
# #
# [+:abort_on_failure+] # [+:abort_on_failure+]
@ -365,7 +365,7 @@ def rake(command, options = {})
execute_command :rake, command, options execute_command :rake, command, options
end end
# Runs the specified Rails command. # Runs the specified \Rails command.
# #
# rails_command "db:migrate" # rails_command "db:migrate"
# rails_command "db:migrate", env: "production" # rails_command "db:migrate", env: "production"
@ -376,7 +376,7 @@ def rake(command, options = {})
# ==== Options # ==== Options
# #
# [+:env+] # [+:env+]
# The Rails environment in which to run the command. Defaults to # The \Rails environment in which to run the command. Defaults to
# <tt>ENV["RAILS_ENV"] || "development"</tt>. # <tt>ENV["RAILS_ENV"] || "development"</tt>.
# #
# [+:abort_on_failure+] # [+:abort_on_failure+]
@ -402,7 +402,7 @@ def rails_command(command, options = {})
end end
end end
# Make an entry in Rails routing file <tt>config/routes.rb</tt> # Make an entry in \Rails routing file <tt>config/routes.rb</tt>
# #
# route "root 'welcome#index'" # route "root 'welcome#index'"
# route "root 'admin#index'", namespace: :admin # route "root 'admin#index'", namespace: :admin

@ -2,7 +2,7 @@
module Rails module Rails
module Generators module Generators
# ActiveModel is a class to be implemented by each ORM to allow Rails to # ActiveModel is a class to be implemented by each ORM to allow \Rails to
# generate customized controller code. # generate customized controller code.
# #
# The API has the same methods as ActiveRecord, but each method returns a # The API has the same methods as ActiveRecord, but each method returns a

@ -86,8 +86,8 @@ def self.hide!
# "rails:test_unit", "test_unit:controller", "test_unit" # "rails:test_unit", "test_unit:controller", "test_unit"
# #
# Notice that "rails:generators:test_unit" could be loaded as well, what # Notice that "rails:generators:test_unit" could be loaded as well, what
# Rails looks for is the first and last parts of the namespace. This is what # \Rails looks for is the first and last parts of the namespace. This is what
# allows any test framework to hook into Rails as long as it provides any # allows any test framework to hook into \Rails as long as it provides any
# of the hooks above. # of the hooks above.
# #
# ==== Options # ==== Options
@ -325,7 +325,7 @@ def namespaced_path # :doc:
@namespaced_path ||= namespace_dirs.join("/") @namespaced_path ||= namespace_dirs.join("/")
end end
# Use Rails default banner. # Use \Rails default banner.
def self.banner # :doc: def self.banner # :doc:
"bin/rails generate #{namespace.delete_prefix("rails:")} #{arguments.map(&:usage).join(' ')} [options]".gsub(/\s+/, " ") "bin/rails generate #{namespace.delete_prefix("rails:")} #{arguments.map(&:usage).join(' ')} [options]".gsub(/\s+/, " ")
end end

@ -3,7 +3,7 @@
module Rails module Rails
# Built-in Health Check Endpoint # Built-in Health Check Endpoint
# #
# Rails also comes with a built-in health check endpoint that is reachable at # \Rails also comes with a built-in health check endpoint that is reachable at
# the +/up+ path. This endpoint will return a 200 status code if the app has # the +/up+ path. This endpoint will return a 200 status code if the app has
# booted with no exceptions, and a 500 status code otherwise. # booted with no exceptions, and a 500 status code otherwise.
# #
@ -13,7 +13,7 @@ module Rails
# health. This health check is designed to be a one-size fits all that will work # health. This health check is designed to be a one-size fits all that will work
# in many situations. # in many situations.
# #
# While any newly generated Rails applications will have the health check at # While any newly generated \Rails applications will have the health check at
# +/up+, you can configure the path to be anything you'd like in your # +/up+, you can configure the path to be anything you'd like in your
# <tt>"config/routes.rb"</tt>: # <tt>"config/routes.rb"</tt>:
# #

@ -4,7 +4,7 @@
module Rails module Rails
# This module helps build the runtime properties that are displayed in # This module helps build the runtime properties that are displayed in
# Rails::InfoController responses. These include the active Rails version, # Rails::InfoController responses. These include the active \Rails version,
# Ruby version, Rack version, and so on. # Ruby version, Rack version, and so on.
module Info module Info
mattr_accessor :properties, default: [] mattr_accessor :properties, default: []

@ -7,34 +7,34 @@
require "active_support/core_ext/module/delegation" require "active_support/core_ext/module/delegation"
module Rails module Rails
# +Rails::Railtie+ is the core of the Rails framework and provides # +Rails::Railtie+ is the core of the \Rails framework and provides
# several hooks to extend Rails and/or modify the initialization process. # several hooks to extend \Rails and/or modify the initialization process.
# #
# Every major component of Rails (Action Mailer, Action Controller, Active # Every major component of \Rails (Action Mailer, Action Controller, Active
# Record, etc.) implements a railtie. Each of them is responsible for their # Record, etc.) implements a railtie. Each of them is responsible for their
# own initialization. This makes Rails itself absent of any component hooks, # 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. # allowing other components to be used in place of any of the \Rails defaults.
# #
# Developing a Rails extension does _not_ require implementing a railtie, but # Developing a \Rails extension does _not_ require implementing a railtie, but
# if you need to interact with the Rails framework during or after boot, then # if you need to interact with the \Rails framework during or after boot, then
# a railtie is needed. # a railtie is needed.
# #
# For example, an extension doing any of the following would need a railtie: # For example, an extension doing any of the following would need a railtie:
# #
# * creating initializers # * creating initializers
# * configuring a Rails framework for the application, like setting a generator # * configuring a \Rails framework for the application, like setting a generator
# * adding <tt>config.*</tt> keys to the environment # * adding <tt>config.*</tt> keys to the environment
# * setting up a subscriber with ActiveSupport::Notifications # * setting up a subscriber with ActiveSupport::Notifications
# * adding Rake tasks # * adding Rake tasks
# #
# == Creating a Railtie # == Creating a Railtie
# #
# To extend Rails using a railtie, create a subclass of +Rails::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 # This class must be loaded during the \Rails boot process, and is conventionally
# called +MyNamespace::Railtie+. # called +MyNamespace::Railtie+.
# #
# The following example demonstrates an extension which can be used with or # The following example demonstrates an extension which can be used with or
# without Rails. # without \Rails.
# #
# # lib/my_gem/railtie.rb # # lib/my_gem/railtie.rb
# module MyGem # module MyGem
@ -47,7 +47,7 @@ module Rails
# #
# == Initializers # == Initializers
# #
# To add an initialization step to the Rails boot process from your railtie, just # To add an initialization step to the \Rails boot process from your railtie, just
# define the initialization code with the +initializer+ macro: # define the initialization code with the +initializer+ macro:
# #
# class MyRailtie < Rails::Railtie # class MyRailtie < Rails::Railtie
@ -87,7 +87,7 @@ module Rails
# #
# == Loading Rake Tasks and Generators # == Loading Rake Tasks and Generators
# #
# If your railtie has Rake tasks, you can tell Rails to load them through the method # If your railtie has Rake tasks, you can tell \Rails to load them through the method
# +rake_tasks+: # +rake_tasks+:
# #
# class MyRailtie < Rails::Railtie # class MyRailtie < Rails::Railtie
@ -96,7 +96,7 @@ module Rails
# end # end
# end # end
# #
# By default, Rails loads generators from your load path. However, if you want to place # By default, \Rails loads generators from your load path. However, if you want to place
# your generators at a different location, you can specify in your railtie a block which # your generators at a different location, you can specify in your railtie a block which
# will load them during normal generators lookup: # will load them during normal generators lookup:
# #
@ -109,13 +109,13 @@ module Rails
# Since filenames on the load path are shared across gems, be sure that files you load # Since filenames on the load path are shared across gems, be sure that files you load
# through a railtie have unique names. # through a railtie have unique names.
# #
# == Run another program when the Rails server starts # == Run another program when the \Rails server starts
# #
# In development, it's very usual to have to run another process next to the Rails Server. In example # In development, it's very usual to have to run another process next to the \Rails Server. In example
# you might want to start the Webpack or React server. Or maybe you need to run your job scheduler process # you might want to start the Webpack or React server. Or maybe you need to run your job scheduler process
# like Sidekiq. This is usually done by opening a new shell and running the program from here. # like Sidekiq. This is usually done by opening a new shell and running the program from here.
# #
# Rails allow you to specify a +server+ block which will get called when a Rails server starts. # \Rails allow you to specify a +server+ block which will get called when a \Rails server starts.
# This way, your users don't need to remember to have to open a new shell and run another program, making # This way, your users don't need to remember to have to open a new shell and run another program, making
# this less confusing for everyone. # this less confusing for everyone.
# It can be used like this: # It can be used like this:

@ -3,7 +3,7 @@
require_relative "gem_version" require_relative "gem_version"
module Rails module Rails
# Returns the currently loaded version of Rails as a string. # Returns the currently loaded version of \Rails as a string.
def self.version def self.version
VERSION::STRING VERSION::STRING
end end

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
module Rails module Rails
# Returns the currently loaded version of Rails as a +Gem::Version+. # Returns the currently loaded version of \Rails as a +Gem::Version+.
def self.gem_version def self.gem_version
Gem::Version.new VERSION::STRING Gem::Version.new VERSION::STRING
end end