Skip to content

Commit 8739729

Browse files
Merge pull request rails#37947 from liljack/rails-documentation-contribution
Clarify documentation by removing charged words [ci skip]
2 parents 2bcf247 + b0743dd commit 8739729

6 files changed

+21
-24
lines changed

guides/source/active_record_basics.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ NOTE: While these column names are optional, they are in fact reserved by Active
133133
Creating Active Record Models
134134
-----------------------------
135135

136-
It is very easy to create Active Record models. All you have to do is to
137-
subclass the `ApplicationRecord` class and you're good to go:
136+
To create Active Record models, subclass the `ApplicationRecord` class and you're good to go:
138137

139138
```ruby
140139
class Product < ApplicationRecord

guides/source/active_record_callbacks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ The callback only runs when all the `:if` conditions and none of the `:unless` c
354354
Callback Classes
355355
----------------
356356

357-
Sometimes the callback methods that you'll write will be useful enough to be reused by other models. Active Record makes it possible to create classes that encapsulate the callback methods, so it becomes very easy to reuse them.
357+
Sometimes the callback methods that you'll write will be useful enough to be reused by other models. Active Record makes it possible to create classes that encapsulate the callback methods, so they can be reused.
358358

359359
Here's an example where we create a class with an `after_destroy` callback for a `PictureFile` model:
360360

guides/source/active_record_migrations.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ Active Record Migrations
55

66
Migrations are a feature of Active Record that allows you to evolve your
77
database schema over time. Rather than write schema modifications in pure SQL,
8-
migrations allow you to use an easy Ruby DSL to describe changes to your
9-
tables.
8+
migrations allow you to use a Ruby DSL to describe changes to your tables.
109

1110
After reading this guide, you will know:
1211

@@ -22,7 +21,7 @@ Migration Overview
2221

2322
Migrations are a convenient way to
2423
[alter your database schema over time](https://en.wikipedia.org/wiki/Schema_migration)
25-
in a consistent and easy way. They use a Ruby DSL so that you don't have to
24+
in a consistent way. They use a Ruby DSL so that you don't have to
2625
write SQL by hand, allowing your schema and changes to be database independent.
2726

2827
You can think of each migration as being a new 'version' of the database. A
@@ -497,7 +496,7 @@ NOTE: Active Record only supports single column foreign keys. `execute` and
497496
`structure.sql` are required to use composite foreign keys. See
498497
[Schema Dumping and You](#schema-dumping-and-you).
499498

500-
Removing a foreign key is easy as well:
499+
Foreign keys can also be removed:
501500

502501
```ruby
503502
# let Active Record figure out the column name
@@ -789,7 +788,7 @@ $ rails db:migrate:redo STEP=3
789788
```
790789

791790
Neither of these rails commands do anything you could not do with `db:migrate`. They
792-
are simply more convenient, since you do not need to explicitly specify the
791+
are there for convenience, since you do not need to explicitly specify the
793792
version to migrate to.
794793

795794
### Setup the Database
@@ -1036,9 +1035,9 @@ end
10361035
```
10371036
10381037
To add initial data after a database is created, Rails has a built-in
1039-
'seeds' feature that makes the process quick and easy. This is especially
1038+
'seeds' feature that speeds up the process. This is especially
10401039
useful when reloading the database frequently in development and test environments.
1041-
It's easy to get started with this feature: just fill up `db/seeds.rb` with some
1040+
To get started with this feature, fill up `db/seeds.rb` with some
10421041
Ruby code, and run `rails db:seed`:
10431042
10441043
```ruby

guides/source/active_record_validations.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ database. For example, it may be important to your application to ensure that
4242
every user provides a valid email address and mailing address. Model-level
4343
validations are the best way to ensure that only valid data is saved into your
4444
database. They are database agnostic, cannot be bypassed by end users, and are
45-
convenient to test and maintain. Rails makes them easy to use, provides
46-
built-in helpers for common needs, and allows you to create your own validation
47-
methods as well.
45+
convenient to test and maintain. Rails provides built-in helpers for common
46+
needs, and allows you to create your own validation methods as well.
4847

4948
There are several other ways to validate data before it is saved into your
5049
database, including native database constraints, client-side validations and
@@ -77,7 +76,7 @@ example using the `new` method, that object does not belong to the database
7776
yet. Once you call `save` upon that object it will be saved into the
7877
appropriate database table. Active Record uses the `new_record?` instance
7978
method to determine whether an object is already in the database or not.
80-
Consider the following simple Active Record class:
79+
Consider the following Active Record class:
8180

8281
```ruby
8382
class Person < ApplicationRecord
@@ -123,7 +122,7 @@ database only if the object is valid:
123122

124123
The bang versions (e.g. `save!`) raise an exception if the record is invalid.
125124
The non-bang versions don't: `save` and `update` return `false`, and
126-
`create` just returns the object.
125+
`create` returns the object.
127126

128127
### Skipping Validations
129128

@@ -204,7 +203,7 @@ end
204203
# => ActiveRecord::RecordInvalid: Validation failed: Name can't be blank
205204
```
206205

207-
`invalid?` is simply the inverse of `valid?`. It triggers your validations,
206+
`invalid?` is the inverse of `valid?`. It triggers your validations,
208207
returning true if any errors were found in the object, and false otherwise.
209208

210209
### `errors[]`
@@ -307,7 +306,7 @@ end
307306

308307
This validation is very specific to web applications and this
309308
'acceptance' does not need to be recorded anywhere in your database. If you
310-
don't have a field for it, the helper will just create a virtual attribute. If
309+
don't have a field for it, the helper will create a virtual attribute. If
311310
the field does exist in your database, the `accept` option must be set to
312311
or include `true` or else the validation will not run.
313312

@@ -1198,7 +1197,7 @@ validator type.
11981197

11991198
### `errors[:base]`
12001199

1201-
You can add error messages that are related to the object's state as a whole, instead of being related to a specific attribute. You can use this method when you want to say that the object is invalid, no matter the values of its attributes. Since `errors[:base]` is an array, you can simply add a string to it and it will be used as an error message.
1200+
You can add error messages that are related to the object's state as a whole, instead of being related to a specific attribute. You can use this method when you want to say that the object is invalid, no matter the values of its attributes. Since `errors[:base]` is an array, you can add a string to it and it will be used as an error message.
12021201

12031202
```ruby
12041203
class Person < ApplicationRecord
@@ -1259,7 +1258,7 @@ validations fail.
12591258
Because every application handles this kind of thing differently, Rails does
12601259
not include any view helpers to help you generate these messages directly.
12611260
However, due to the rich number of methods Rails gives you to interact with
1262-
validations in general, it's fairly easy to build your own. In addition, when
1261+
validations in general, you can build your own. In addition, when
12631262
generating a scaffold, Rails will put some ERB into the `_form.html.erb` that
12641263
it generates that displays the full list of errors on that model.
12651264

guides/source/association_basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ NOTE: Using `t.bigint :supplier_id` makes the foreign key naming obvious and exp
406406

407407
### Choosing Between `has_many :through` and `has_and_belongs_to_many`
408408

409-
Rails offers two different ways to declare a many-to-many relationship between models. The simpler way is to use `has_and_belongs_to_many`, which allows you to make the association directly:
409+
Rails offers two different ways to declare a many-to-many relationship between models. The first way is to use `has_and_belongs_to_many`, which allows you to make the association directly:
410410

411411
```ruby
412412
class Assembly < ApplicationRecord
@@ -2459,7 +2459,7 @@ Let's say we have Car, Motorcycle, and Bicycle models. We will want to share
24592459
the `color` and `price` fields and some methods for all of them, but having some
24602460
specific behavior for each, and separated controllers too.
24612461

2462-
Rails makes this quite easy. First, let's generate the base Vehicle model:
2462+
First, let's generate the base Vehicle model:
24632463

24642464
```bash
24652465
$ rails generate model vehicle type:string color:string price:decimal{10.2}
@@ -2503,7 +2503,7 @@ will generate the following SQL:
25032503
INSERT INTO "vehicles" ("type", "color", "price") VALUES ('Car', 'Red', 10000)
25042504
```
25052505

2506-
Querying car records will just search for vehicles that are cars:
2506+
Querying car records will search only for vehicles that are cars:
25072507

25082508
```ruby
25092509
Car.all

guides/source/contributing_to_ruby_on_rails.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ Having a way to reproduce your issue will be very helpful for others to help con
4848

4949
These templates include the boilerplate code to set up a test case against either a released version of Rails (`*_gem.rb`) or edge Rails (`*_master.rb`).
5050

51-
Simply copy the content of the appropriate template into a `.rb` file and make the necessary changes to demonstrate the issue. You can execute it by running `ruby the_file.rb` in your terminal. If all goes well, you should see your test case failing.
51+
Copy the content of the appropriate template into a `.rb` file and make the necessary changes to demonstrate the issue. You can execute it by running `ruby the_file.rb` in your terminal. If all goes well, you should see your test case failing.
5252

53-
You can then share your executable test case as a [gist](https://gist.github.com), or simply paste the content into the issue description.
53+
You can then share your executable test case as a [gist](https://gist.github.com), or paste the content into the issue description.
5454

5555
### Special Treatment for Security Issues
5656

0 commit comments

Comments
 (0)