mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #20663 from andreynering/patch-1
Minor fixes [ci skip]
This commit is contained in:
commit
d8458df97f
1 changed files with 2 additions and 2 deletions
|
@ -2344,13 +2344,13 @@ associations, public methods, etc.
|
|||
Creating a car will save it in the `vehicles` table with "Car" as the `type` field:
|
||||
|
||||
```ruby
|
||||
Car.create color: 'Red', price: 10000
|
||||
Car.create(color: 'Red', price: 10000)
|
||||
```
|
||||
|
||||
will generate the following SQL:
|
||||
|
||||
```sql
|
||||
INSERT INTO "vehicles" ("type", "color", "price") VALUES ("Car", "Red", 10000)
|
||||
INSERT INTO "vehicles" ("type", "color", "price") VALUES ('Car', 'Red', 10000)
|
||||
```
|
||||
|
||||
Querying car records will just search for vehicles that are cars:
|
||||
|
|
Loading…
Reference in a new issue