Skip to content

Commit 0b627b7

Browse files
authored
Merge pull request rails#54993 from duffuniverse/fix-typos-in-multiple-databases-guide
[ci skip] Fix typos in the Multiple Databases with Active Record guide
1 parent 6814f71 commit 0b627b7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

guides/source/active_record_multiple_databases.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class Person < PrimaryApplicationRecord
138138
end
139139
```
140140

141-
On the other hand, we need to setup our models persisted in the "animals" database:
141+
On the other hand, we need to set up our models persisted in the "animals" database:
142142

143143
```ruby
144144
class AnimalsRecord < ApplicationRecord
@@ -212,7 +212,7 @@ db:setup:primary # Create the primary database, loads the sche
212212

213213
Running a command like `bin/rails db:create` will create both the primary and animals databases.
214214
Note that there is no command for creating the database users, and you'll need to do that manually
215-
to support the readonly users for your replicas. If you want to create just the animals
215+
to support the read-only users for your replicas. If you want to create just the animals
216216
database you can run `bin/rails db:create:animals`.
217217

218218
## Connecting to Databases without Managing Schema and Migrations
@@ -295,8 +295,8 @@ use a different parent class.
295295
Finally, in order to use the read-only replica in your application, you'll need to activate
296296
the middleware for automatic switching.
297297

298-
Automatic switching allows the application to switch from the writer to replica or replica
299-
to writer based on the HTTP verb and whether there was a recent write by the requesting user.
298+
Automatic switching allows the application to switch from the writer to the replica or the replica
299+
to the writer based on the HTTP verb and whether there was a recent write by the requesting user.
300300

301301
If the application receives a POST, PUT, DELETE, or PATCH request, the application will
302302
automatically write to the writer database. If the request is not one of those methods,
@@ -328,7 +328,7 @@ to the replicas unless they wrote recently.
328328

329329
The automatic connection switching in Rails is relatively primitive and deliberately doesn't
330330
do a whole lot. The goal is a system that demonstrates how to do automatic connection
331-
switching that was flexible enough to be customizable by app developers.
331+
switching that is flexible enough to be customizable by app developers.
332332

333333
The setup in Rails allows you to easily change how the switching is done and what
334334
parameters it's based on. Let's say you want to use a cookie instead of a session to
@@ -392,7 +392,7 @@ using the connection specification name. This means that if you pass an unknown
392392
like `connected_to(role: :nonexistent)` you will get an error that says
393393
`ActiveRecord::ConnectionNotEstablished (No connection pool for 'ActiveRecord::Base' found for the 'nonexistent' role.)`
394394

395-
If you want Rails to ensure any queries performed are read only, pass `prevent_writes: true`.
395+
If you want Rails to ensure any queries performed are read-only, pass `prevent_writes: true`.
396396
This just prevents queries that look like writes from being sent to the database.
397397
You should also configure your replica database to run in read-only mode.
398398

@@ -517,7 +517,7 @@ end
517517
```
518518

519519
Applications must provide a resolver to provide application-specific logic. An example resolver that
520-
uses subdomain to determine the shard might look like this:
520+
uses a subdomain to determine the shard might look like this:
521521

522522
```ruby
523523
config.active_record.shard_resolver = ->(request) {

0 commit comments

Comments
 (0)