aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/active_record_basics.md
diff options
context:
space:
mode:
authorloothunter1 <35389681+loothunter1@users.noreply.github.com>2018-01-24 01:39:40 +0300
committerRafael França <rafaelmfranca@gmail.com>2018-01-23 17:39:40 -0500
commit97e9331317a15dbd4a865daaa1d5255a0820597e (patch)
treeaf7262a8873e2eb2f35f1d690b9736cb46feafbb /guides/source/active_record_basics.md
parent4cfd40a5802c7db8d7a6b4f0a9d072f09bfcdbf6 (diff)
downloadrails-97e9331317a15dbd4a865daaa1d5255a0820597e.tar.gz
rails-97e9331317a15dbd4a865daaa1d5255a0820597e.tar.bz2
rails-97e9331317a15dbd4a865daaa1d5255a0820597e.zip
Clarification for noobs. (#31704)
* Update active_record_basics.md I made a bit of clarification for people, who are not familiar with SQL (pretty much like me). However, I don't know what tutorial for MySQL is better, so I haven't inserted a link yet. * [ci skip] For those who new to GitHub Added more instructions for contributing guides. Without them, it was somewhat confusing for me to find what I should actually do. * Update active_record_basics.md Fixed grammar and text wrapping as requested. * Update contributing_to_ruby_on_rails.md Revised instructions. * Update contributing_to_ruby_on_rails.md Typos * Update active_record_basics.md * [ci skip] Update active_record_basics Added a few links to SQL tutorials found on the net. Also, changed MySQL to SQL (or one of its extensions) - I think that it's a good compromise. * [ci skip] I think now it's more clear what to do. * [ci skip] Fixed strings [Rafael Mendonça França + loothunter1]
Diffstat (limited to 'guides/source/active_record_basics.md')
-rw-r--r--guides/source/active_record_basics.md9
1 files changed, 6 insertions, 3 deletions
diff --git a/guides/source/active_record_basics.md b/guides/source/active_record_basics.md
index 9be9c6c7b7..859679d53a 100644
--- a/guides/source/active_record_basics.md
+++ b/guides/source/active_record_basics.md
@@ -45,6 +45,8 @@ relationships of the objects in an application can be easily stored and
retrieved from a database without writing SQL statements directly and with less
overall database access code.
+NOTE: If you are not familiar enough with relational database management systems (rDBMS) or structured query language (SQL), please go through [this tutorial](https://www.w3schools.com/sql/default.asp) (or [this one](http://www.sqlcourse.com/)) or study them by other means. Understanding how relational databases work is crucial to understanding Active Records and Rails in general.
+
### Active Record as an ORM Framework
Active Record gives us several mechanisms, the most important being the ability
@@ -142,7 +144,7 @@ end
This will create a `Product` model, mapped to a `products` table at the
database. By doing this you'll also have the ability to map the columns of each
row in that table with the attributes of the instances of your model. Suppose
-that the `products` table was created using an SQL statement like:
+that the `products` table was created using a SQL (or one of its extensions) statement like:
```sql
CREATE TABLE products (
@@ -152,8 +154,9 @@ CREATE TABLE products (
);
```
-Following the table schema above, you would be able to write code like the
-following:
+Schema above declares a table with two columns: `id` and `name`. Each row of
+this table represents a certain product with these two parameters. Thus, you
+would be able to write code like the following:
```ruby
p = Product.new