aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorJason Noble <github+jasonn@jasonnoble.org>2012-11-24 22:37:50 -0700
committerJason Noble <github+jasonn@jasonnoble.org>2012-11-24 22:37:50 -0700
commit9314867b1fefffa4c5a1a876886fde6655bd2dae (patch)
treecbedbf8082718e3bdf1ee45f37226335f8a1e9a1 /guides
parent3e8c4bc6c62a7995821c6835e3314a1411cec43b (diff)
downloadrails-9314867b1fefffa4c5a1a876886fde6655bd2dae.tar.gz
rails-9314867b1fefffa4c5a1a876886fde6655bd2dae.tar.bz2
rails-9314867b1fefffa4c5a1a876886fde6655bd2dae.zip
Moved position of has_many
Diffstat (limited to 'guides')
-rw-r--r--guides/source/getting_started.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md
index 64435c0d5b..c517d23e40 100644
--- a/guides/source/getting_started.md
+++ b/guides/source/getting_started.md
@@ -1292,6 +1292,7 @@ makes each comment belong to a Post:
```ruby
class Comment < ActiveRecord::Base
belongs_to :post
+ attr_accessible :body, :commenter
end
```
@@ -1299,10 +1300,10 @@ You'll need to edit the `post.rb` file to add the other side of the association:
```ruby
class Post < ActiveRecord::Base
+ has_many :comments
validates :title, presence: true,
length: { minimum: 5 }
-
- has_many :comments
+ [...]
end
```