Skip to content

Commit 61a3e61

Browse files
Minor text / error message tweaks, fixes, and punctuation
Improve a few sentences and add punctuation to some recent changelog & guide entries. [ci skip]
1 parent 2ee11cd commit 61a3e61

File tree

5 files changed

+17
-18
lines changed

5 files changed

+17
-18
lines changed

activerecord/CHANGELOG.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
* Allow association's `foreign_key` to be composite
1+
* Allow association's `foreign_key` to be composite.
22

33
`query_constraints` option was the only way to configure a composite foreign key by passing an `Array`.
44
Now it's possible to pass an Array value as `foreign_key` to achieve the same behavior of an association.
55

66
*Nikita Vasilevsky*
77

8-
* Allow association's `primary_key` to be composite
8+
* Allow association's `primary_key` to be composite.
99

1010
Association's `primary_key` can be composite when derived from associated model `primary_key` or `query_constraints`.
1111
Now it's possible to explicitly set it as composite on the association.
@@ -16,7 +16,7 @@
1616

1717
Controls whether `ActiveRecord::Base.connection` raises an error, emits a deprecation warning, or neither.
1818

19-
`ActiveRecord::Base.connection` checkouts a database connection from the pool and keep it leased until the end of
19+
`ActiveRecord::Base.connection` checkouts a database connection from the pool and keeps it leased until the end of
2020
the request or job. This behavior can be undesirable in environments that use many more threads or fibers than there
2121
is available connections.
2222

@@ -27,7 +27,7 @@
2727

2828
*Jean Boussier*
2929

30-
* Add dirties option to uncached
30+
* Add dirties option to uncached.
3131

3232
This adds a `dirties` option to `ActiveRecord::Base.uncached` and
3333
`ActiveRecord::ConnectionAdapters::ConnectionPool#uncached`.
@@ -39,7 +39,7 @@
3939

4040
*Donal McBreen*
4141

42-
* Deprecate `ActiveRecord::Base.connection` in favor of `.lease_connection`
42+
* Deprecate `ActiveRecord::Base.connection` in favor of `.lease_connection`.
4343

4444
The method has been renamed as `lease_connection` to better reflect that the returned
4545
connection will be held for the duration of the request or job.
@@ -49,14 +49,14 @@
4949

5050
*Jean Boussier*
5151

52-
* Deprecate `ActiveRecord::ConnectionAdapters::ConnectionPool#connection`
52+
* Deprecate `ActiveRecord::ConnectionAdapters::ConnectionPool#connection`.
5353

5454
The method has been renamed as `lease_connection` to better reflect that the returned
5555
connection will be held for the duration of the request or job.
5656

5757
*Jean Boussier*
5858

59-
* Expose a generic fixture accessor for fixture names that may conflict with Minitest
59+
* Expose a generic fixture accessor for fixture names that may conflict with Minitest.
6060

6161
```ruby
6262
assert_equal "Ruby on Rails", web_sites(:rubyonrails).name

activerecord/lib/active_record.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def self.global_executor_concurrency # :nodoc:
303303
@permanent_connection_checkout = true
304304
singleton_class.attr_reader :permanent_connection_checkout
305305

306-
# Defines whether +ActiveRecord::Base.connection+ is allowed, deprecated or entirely disallowed
306+
# Defines whether +ActiveRecord::Base.connection+ is allowed, deprecated, or entirely disallowed.
307307
def self.permanent_connection_checkout=(value)
308308
unless [true, :deprecated, :disallowed].include?(value)
309309
raise ArgumentError, "permanent_connection_checkout must be one of: `true`, `:deprecated` or `:disallowed`"

activerecord/lib/active_record/connection_handling.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,13 @@ def connection
263263
case ActiveRecord.permanent_connection_checkout
264264
when :deprecated
265265
ActiveRecord.deprecator.warn <<~MESSAGE
266-
Called deprecated `ActionRecord::Base.connection`method.
266+
Called deprecated `ActionRecord::Base.connection` method.
267267
268268
Either use `with_connection` or `lease_connection`.
269269
MESSAGE
270270
when :disallowed
271271
raise ActiveRecordError, <<~MESSAGE
272-
Called deprecated `ActionRecord::Base.connection`method.
272+
Called deprecated `ActionRecord::Base.connection` method.
273273
274274
Either use `with_connection` or `lease_connection`.
275275
MESSAGE

guides/source/configuring.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ Controls whether migrations are numbered with serial integers or with timestamps
10541054
10551055
#### `config.active_record.automatically_invert_plural_associations`
10561056
1057-
Controls whether Active Record will automatically look for an inverse relations with a pluralized name.
1057+
Controls whether Active Record will automatically look for inverse relations with a pluralized name.
10581058
10591059
Example:
10601060
@@ -1076,7 +1076,6 @@ it may cause backward compatibility issues with legacy code that doesn't expect
10761076
10771077
This behavior can be disabled on a per-model basis:
10781078
1079-
10801079
```ruby
10811080
class Comment < ApplicationRecord
10821081
self.automatically_invert_plural_associations = false
@@ -1089,7 +1088,7 @@ And on a per-association basis:
10891088
10901089
```ruby
10911090
class Comment < ApplicationRecord
1092-
self.automatically_invert_plural_associations = false
1091+
self.automatically_invert_plural_associations = true
10931092
10941093
belongs_to :post, inverse_of: false
10951094
end
@@ -1575,14 +1574,14 @@ record.token # => "fwZcXX6SkJBJRogzMdciS7wf"
15751574

15761575
Controls whether `ActiveRecord::Base.connection` raises an error, emits a deprecation warning, or neither.
15771576

1578-
`ActiveRecord::Base.connection` checkouts a database connection from the pool and keep it leased until the end of
1577+
`ActiveRecord::Base.connection` checkouts a database connection from the pool and keeps it leased until the end of
15791578
the request or job. This behavior can be undesirable in environments that use many more threads or fibers than there
15801579
is available connections.
15811580

15821581
This configuration can be used to track down and eliminate code that calls `ActiveRecord::Base.connection` and
15831582
migrate it to use `ActiveRecord::Base.with_connection` instead.
15841583

1585-
The value can be set to `:disallowed`, `:deprecated` or `true` to respectively raise an error, emit a deprecation
1584+
The value can be set to `:disallowed`, `:deprecated`, or `true` to respectively raise an error, emit a deprecation
15861585
warning, or neither.
15871586

15881587
| Starting with version | The default value is |

railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929
# Rails.application.config.active_record.validate_migration_timestamps = true
3030

3131
###
32-
# Controls whether Active Record will automatically look for an inverse relations
32+
# Controls whether Active Record will automatically look for inverse relations
3333
# with a pluralized name.
3434
#
3535
# Example:
3636
# class Comment < ActiveRecord::Base
3737
# belongs_to :post
3838
# end
3939
#
40-
# In the above case Active Record will now try to infer a `:comments` relation
41-
# on `Post`, while previously it would only look for `:comment`.
40+
# In this example, Active Record will try to infer a `:comment` (singular) association
41+
# on `Post`. With this option enabled, it will also look for a `:comments` association.
4242
#++
4343
# Rails.application.config.active_record.automatically_invert_plural_associations = true

0 commit comments

Comments
 (0)