Skip to content

Commit

Permalink
Format inline code [ci-skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanhefner committed Nov 15, 2022
1 parent cb34c92 commit 9588f78
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions actionpack/lib/action_dispatch/http/filter_parameters.rb
Expand Up @@ -7,10 +7,10 @@ module Http
# Allows you to specify sensitive parameters which will be replaced from
# the request log by looking in the query string of the request and all
# sub-hashes of the params hash to filter. Filtering only certain sub-keys
# from a hash is possible by using the dot notation: 'credit_card.number'.
# from a hash is possible by using the dot notation: <tt>"credit_card.number"</tt>.
# If a block is given, each key and value of the params hash and all
# sub-hashes are passed to it, where the value or the key can be replaced using
# String#replace or similar methods.
# <tt>String#replace</tt> or similar methods.
#
# env["action_dispatch.parameter_filter"] = [:password]
# => replaces the value to all keys matching /password/i with "[FILTERED]"
Expand Down
22 changes: 11 additions & 11 deletions actionpack/lib/action_dispatch/routing/url_for.rb
Expand Up @@ -6,16 +6,16 @@ module Routing
# is also possible: a URL can be generated from one of your routing definitions.
# URL generation functionality is centralized in this module.
#
# See ActionDispatch::Routing for general information about routing and routes.rb.
# See ActionDispatch::Routing for general information about routing and <tt>config/routes.rb</tt>.
#
# <b>Tip:</b> If you need to generate URLs from your models or some other place,
# then ActionController::UrlFor is what you're looking for. Read on for
# an introduction. In general, this module should not be included on its own,
# as it is usually included by url_helpers (as in Rails.application.routes.url_helpers).
# as it is usually included by +url_helpers+ (as in <tt>Rails.application.routes.url_helpers</tt>).
#
# == URL generation from parameters
#
# As you may know, some functions, such as ActionController::Base#url_for
# As you may know, some functions, such as <tt>ActionController::Base#url_for</tt>
# and ActionView::Helpers::UrlHelper#link_to, can generate URLs given a set
# of parameters. For example, you've probably had the chance to write code
# like this in one of your views:
Expand All @@ -24,7 +24,7 @@ module Routing
# action: 'new', message: 'Welcome!') %>
# # => <a href="/users/new?message=Welcome%21">Click here</a>
#
# link_to, and all other functions that require URL generation functionality,
# +link_to+, and all other functions that require URL generation functionality,
# actually use ActionController::UrlFor under the hood. And in particular,
# they use the ActionController::UrlFor#url_for method. One can generate
# the same path as the above example by using the following code:
Expand All @@ -48,8 +48,8 @@ module Routing
# host: 'www.example.com')
# # => "http://www.example.com/users/new?message=Welcome%21"
#
# By default, all controllers and views have access to a special version of url_for,
# that already knows what the current hostname is. So if you use url_for in your
# By default, all controllers and views have access to a special version of +url_for+,
# that already knows what the current hostname is. So if you use +url_for+ in your
# controllers or your views, then you don't need to explicitly pass the <tt>:host</tt>
# argument.
#
Expand All @@ -72,7 +72,7 @@ module Routing
# This generates, among other things, the method <tt>users_path</tt>. By default,
# this method is accessible from your controllers, views, and mailers. If you need
# to access this auto-generated method from other places (such as a model), then
# you can do that by including Rails.application.routes.url_helpers in your class:
# you can do that by including <tt>Rails.application.routes.url_helpers</tt> in your class:
#
# class User < ActiveRecord::Base
# include Rails.application.routes.url_helpers
Expand Down Expand Up @@ -115,11 +115,11 @@ def url_options
default_url_options
end

# Generate a URL based on the options provided, default_url_options, and the
# routes defined in routes.rb. The following options are supported:
# Generate a URL based on the options provided, +default_url_options+, and the
# routes defined in <tt>config/routes.rb</tt>. The following options are supported:
#
# * <tt>:only_path</tt> - If true, the relative URL is returned. Defaults to +false+.
# * <tt>:protocol</tt> - The protocol to connect to. Defaults to 'http'.
# * <tt>:protocol</tt> - The protocol to connect to. Defaults to <tt>"http"</tt>.
# * <tt>:host</tt> - Specifies the host the link should be targeted at.
# If <tt>:only_path</tt> is false, this option must be
# provided either explicitly, or via +default_url_options+.
Expand All @@ -134,7 +134,7 @@ def url_options
# * <tt>:port</tt> - Optionally specify the port to connect to.
# * <tt>:anchor</tt> - An anchor name to be appended to the path.
# * <tt>:params</tt> - The query parameters to be appended to the path.
# * <tt>:trailing_slash</tt> - If true, adds a trailing slash, as in "/archive/2009/".
# * <tt>:trailing_slash</tt> - If true, adds a trailing slash, as in <tt>"/archive/2009/"</tt>.
# * <tt>:script_name</tt> - Specifies application path relative to domain root. If provided, prepends application path.
#
# Any other key (<tt>:controller</tt>, <tt>:action</tt>, etc.) given to
Expand Down
6 changes: 3 additions & 3 deletions actionview/lib/action_view/routing_url_for.rb
Expand Up @@ -7,13 +7,13 @@ module RoutingUrlFor
# Returns the URL for the set of +options+ provided. This takes the
# same options as +url_for+ in Action Controller (see the
# documentation for <tt>ActionController::Base#url_for</tt>). Note that by default
# <tt>:only_path</tt> is <tt>true</tt> so you'll get the relative "/controller/action"
# instead of the fully qualified URL like "http://example.com/controller/action".
# <tt>:only_path</tt> is <tt>true</tt> so you'll get the relative <tt>"/controller/action"</tt>
# instead of the fully qualified URL like <tt>"http://example.com/controller/action"</tt>.
#
# ==== Options
# * <tt>:anchor</tt> - Specifies the anchor name to be appended to the path.
# * <tt>:only_path</tt> - If true, returns the relative URL (omitting the protocol, host name, and port) (<tt>true</tt> by default unless <tt>:host</tt> is specified).
# * <tt>:trailing_slash</tt> - If true, adds a trailing slash, as in "/archive/2005/". Note that this
# * <tt>:trailing_slash</tt> - If true, adds a trailing slash, as in <tt>"/archive/2005/"</tt>. Note that this
# is currently not recommended since it breaks caching.
# * <tt>:host</tt> - Overrides the default (current) host if provided.
# * <tt>:protocol</tt> - Overrides the default (current) protocol if provided.
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/attribute_methods.rb
Expand Up @@ -311,7 +311,7 @@ def attribute_present?(attr_name)
end

# Returns the value of the attribute identified by <tt>attr_name</tt> after it has been typecast (for example,
# "2004-12-12" in a date column is cast to a date object, like Date.new(2004, 12, 12)). It raises
# "2004-12-12" in a date column is cast to a date object, like <tt>Date.new(2004, 12, 12)</tt>). It raises
# <tt>ActiveModel::MissingAttributeError</tt> if the identified attribute is missing.
#
# Note: +:id+ is always present.
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/attribute_methods/read.rb
Expand Up @@ -23,7 +23,7 @@ def define_method_attribute(name, owner:)

# Returns the value of the attribute identified by <tt>attr_name</tt> after
# it has been typecast (for example, "2004-12-12" in a date column is cast
# to a date object, like Date.new(2004, 12, 12)).
# to a date object, like <tt>Date.new(2004, 12, 12)</tt>).
def read_attribute(attr_name, &block)
name = attr_name.to_s
name = self.class.attribute_aliases[name] || name
Expand Down

0 comments on commit 9588f78

Please sign in to comment.