chore: Use `e.g.` which is the more used spelling
``` % git grep -i '\be\.g\.' | wc -l 290 ```
This commit is contained in:
parent
9e9c563a04
commit
a206aecedf
|
@ -57,7 +57,7 @@ module ActionController
|
|||
#
|
||||
# redirect_to post_url(@post) and return
|
||||
#
|
||||
# Passing user input directly into +redirect_to+ is considered dangerous (eg. `redirect_to(params[:location])`).
|
||||
# Passing user input directly into +redirect_to+ is considered dangerous (e.g. `redirect_to(params[:location])`).
|
||||
# Always use regular expressions or a permitted list when redirecting to a user specified location.
|
||||
def redirect_to(options = {}, response_options = {})
|
||||
raise ActionControllerError.new("Cannot redirect to nil!") unless options
|
||||
|
|
|
@ -1307,7 +1307,7 @@ module ActionDispatch
|
|||
# POST /profile
|
||||
#
|
||||
# If you want instances of a model to work with this resource via
|
||||
# record identification (eg. in +form_with+ or +redirect_to+), you
|
||||
# record identification (e.g. in +form_with+ or +redirect_to+), you
|
||||
# will need to call resolve[rdoc-ref:CustomUrls#resolve]:
|
||||
#
|
||||
# resource :profile
|
||||
|
|
|
@ -182,7 +182,7 @@ module ActiveRecord
|
|||
NATIVE_DATABASE_TYPES
|
||||
end
|
||||
|
||||
# Returns the current database encoding format as a string, eg: 'UTF-8'
|
||||
# Returns the current database encoding format as a string, e.g. 'UTF-8'
|
||||
def encoding
|
||||
@connection.encoding.to_s
|
||||
end
|
||||
|
|
|
@ -35,7 +35,7 @@ module ActiveRecord
|
|||
# name: Google
|
||||
# url: http://www.google.com
|
||||
#
|
||||
# This fixture file includes two fixtures. Each YAML fixture (ie. record) is given a name and
|
||||
# This fixture file includes two fixtures. Each YAML fixture (i.e. record) is given a name and
|
||||
# is followed by an indented list of key/value pairs in the "key: value" format. Records are
|
||||
# separated by a blank line for your viewing pleasure.
|
||||
#
|
||||
|
|
|
@ -14,7 +14,7 @@ module ActiveRecord
|
|||
end
|
||||
|
||||
# This file exists to ensure that old migrations run the same way they did before a Rails upgrade.
|
||||
# eg. if you write a migration on Rails 6.1, then upgrade to Rails 7, the migration should do the same thing to your
|
||||
# e.g. if you write a migration on Rails 6.1, then upgrade to Rails 7, the migration should do the same thing to your
|
||||
# database as it did when you were running Rails 6.1
|
||||
#
|
||||
# "Current" is an alias for `ActiveRecord::Migration`, it represents the current Rails version.
|
||||
|
|
|
@ -501,7 +501,7 @@ module ActiveRecord
|
|||
#
|
||||
# The most common usage pattern for this method is probably in a migration,
|
||||
# when just after creating a table you want to populate it with some default
|
||||
# values, eg:
|
||||
# values, e.g.:
|
||||
#
|
||||
# class CreateJobLevels < ActiveRecord::Migration[7.0]
|
||||
# def up
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
*Steve Laing*
|
||||
|
||||
* `Time#change` and methods that call it (eg. `Time#advance`) will now
|
||||
* `Time#change` and methods that call it (e.g. `Time#advance`) will now
|
||||
return a `Time` with the timezone argument provided, if the caller was
|
||||
initialized with a timezone argument.
|
||||
|
||||
|
|
|
@ -253,7 +253,7 @@ module ActiveSupport
|
|||
warning = <<~MSG
|
||||
#{self.class} - #{name}: #{e.error.class} raised.
|
||||
If you expected this exception, use `assert_raises` as near to the code that raises as possible.
|
||||
Other block based assertions (eg. `#{assertion}`) can be used, as long as `assert_raises` is inside their block.
|
||||
Other block based assertions (e.g. `#{assertion}`) can be used, as long as `assert_raises` is inside their block.
|
||||
MSG
|
||||
tagged_logger.warn warning
|
||||
end
|
||||
|
|
|
@ -363,7 +363,7 @@ class ExceptionsInsideAssertionsTest < ActiveSupport::TestCase
|
|||
expected = <<~MSG
|
||||
ExceptionsInsideAssertionsTest - test_warning_is_logged_if_caught_internally: ArgumentError raised.
|
||||
If you expected this exception, use `assert_raises` as near to the code that raises as possible.
|
||||
Other block based assertions (eg. `assert_no_changes`) can be used, as long as `assert_raises` is inside their block.
|
||||
Other block based assertions (e.g. `assert_no_changes`) can be used, as long as `assert_raises` is inside their block.
|
||||
MSG
|
||||
assert @out.string.include?(expected), @out.string
|
||||
end
|
||||
|
@ -388,7 +388,7 @@ class ExceptionsInsideAssertionsTest < ActiveSupport::TestCase
|
|||
expected = <<~MSG
|
||||
ExceptionsInsideAssertionsTest - test_fails_and_warning_is_logged_if_wrong_error_caught: ArgumentError raised.
|
||||
If you expected this exception, use `assert_raises` as near to the code that raises as possible.
|
||||
Other block based assertions (eg. `assert_no_changes`) can be used, as long as `assert_raises` is inside their block.
|
||||
Other block based assertions (e.g. `assert_no_changes`) can be used, as long as `assert_raises` is inside their block.
|
||||
MSG
|
||||
assert @out.string.include?(expected), @out.string
|
||||
assert error.message.include?("ArgumentError: ArgumentError")
|
||||
|
|
|
@ -26,6 +26,6 @@ driver.quit
|
|||
|
||||
puts "Time: #{result.duration} seconds, Total: #{result.assertions[:total]}, Passed: #{result.assertions[:passed]}, Failed: #{result.assertions[:failed]}"
|
||||
if result.tests[:failed] > 0
|
||||
puts "Qunit output follows. Look for lines that have failures, eg (1, n, n) - those are your failing lines\r\n\r\n#{result.raw_output}"
|
||||
puts "Qunit output follows. Look for lines that have failures, e.g. (1, n, n) - those are your failing lines\r\n\r\n#{result.raw_output}"
|
||||
end
|
||||
exit(result.tests[:failed] > 0 ? 1 : 0)
|
||||
|
|
|
@ -769,7 +769,7 @@ Active Storage supports representing a variety of files. You can call
|
|||
[`representation`][] on an attachment to display an image variant, or a
|
||||
preview of a video or PDF. Before calling `representation`, check if the
|
||||
attachment can be represented by calling [`representable?`]. Some file formats
|
||||
can't be previewed by Active Storage out of the box (eg. Word documents); if
|
||||
can't be previewed by Active Storage out of the box (e.g. Word documents); if
|
||||
`representable?` returns false you may want to [link to](#serving-files)
|
||||
the file instead.
|
||||
|
||||
|
@ -820,7 +820,7 @@ image_tag file.representation(resize_to_limit: [100, 100]).processed.url
|
|||
|
||||
The Active Storage variant tracker improves performance of this, by storing a
|
||||
record in the database if the requested representation has been processed before.
|
||||
Thus, the above code will only make an API call to the remote service (eg. S3)
|
||||
Thus, the above code will only make an API call to the remote service (e.g. S3)
|
||||
once, and once a variant is stored, will use that. The variant tracker runs
|
||||
automatically, but can be disabled through `config.active_storage.track_variants`.
|
||||
|
||||
|
@ -1361,7 +1361,7 @@ end
|
|||
```
|
||||
|
||||
If you're not running parallel tests, use `Minitest.after_run` or the equivalent for your test
|
||||
framework (eg. `after(:suite)` for RSpec):
|
||||
framework (e.g. `after(:suite)` for RSpec):
|
||||
|
||||
```ruby
|
||||
# test_helper.rb
|
||||
|
|
|
@ -44,7 +44,7 @@ module Rails
|
|||
logger.level = ActiveSupport::Logger::WARN
|
||||
logger.warn(
|
||||
"Rails Error: Unable to access log file. Please ensure that #{path} exists and is writable " \
|
||||
"(ie, make it writable for user and group: chmod 0664 #{path}). " \
|
||||
"(i.e. make it writable for user and group: chmod 0664 #{path}). " \
|
||||
"The log level has been raised to WARN and the output directed to STDERR until the problem is fixed."
|
||||
)
|
||||
logger
|
||||
|
|
Loading…
Reference in New Issue