aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/association_basics.md
diff options
context:
space:
mode:
authorMikhail Dieterle <MikDiet@gmail.com>2013-06-15 18:39:17 +0300
committerMikhail Dieterle <MikDiet@gmail.com>2013-06-15 18:39:17 +0300
commit1010f9382b81f5f3a02009126271ac0cbde4bc59 (patch)
treea6caa8b81def8609faaf4cf6c2f78814a793ac44 /guides/source/association_basics.md
parentd4794fd9d2bd29473c0968eec7054667abdf0c7a (diff)
downloadrails-1010f9382b81f5f3a02009126271ac0cbde4bc59.tar.gz
rails-1010f9382b81f5f3a02009126271ac0cbde4bc59.tar.bz2
rails-1010f9382b81f5f3a02009126271ac0cbde4bc59.zip
fix quotes and ruby old hashes
Diffstat (limited to 'guides/source/association_basics.md')
-rw-r--r--guides/source/association_basics.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md
index adf430aef4..c0e584a1c7 100644
--- a/guides/source/association_basics.md
+++ b/guides/source/association_basics.md
@@ -1736,15 +1736,15 @@ If you want to make sure that, upon insertion, all of the records in the
persisted association are distinct (so that you can be sure that when you
inspect the association that you will never find duplicate records), you should
add a unique index on the table itself. For example, if you have a table named
-``person_posts`` and you want to make sure all the posts are unique, you could
+`person_posts` and you want to make sure all the posts are unique, you could
add the following in a migration:
```ruby
-add_index :person_posts, :post, :unique => true
+add_index :person_posts, :post, unique: true
```
-Note that checking for uniqueness using something like ``include?`` is subject
-to race conditions. Do not attempt to use ``include?`` to enforce distinctness
+Note that checking for uniqueness using something like `include?` is subject
+to race conditions. Do not attempt to use `include?` to enforce distinctness
in an association. For instance, using the post example from above, the
following code would be racy because multiple users could be attempting this
at the same time: